Skip to content

Commit

Permalink
commands
Browse files Browse the repository at this point in the history
  • Loading branch information
pandrr committed Dec 3, 2024
1 parent 5ab297a commit 7745ead
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src_client/cmd_electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,17 +241,23 @@ CABLES_CMD_STANDALONE.addOpPackage = (options, next) =>
});
};

CABLES_CMD_STANDALONE.copyOpDirToClipboard = () =>
CABLES_CMD_STANDALONE.copyOpDirToClipboard = (opId) =>
{
const gui = standalone.gui;
if (gui)
{
const ops = gui.patchView.getSelectedOps();
if (!ops.length) return;

const op = ops[0];
const modulePath = window.ipcRenderer.sendSync("getOpDir", { "opId": op.opId, "opName": op.name });
if (modulePath) navigator.clipboard.writeText(modulePath);
if (!opId)
{
const ops = gui.patchView.getSelectedOps();
if (!ops.length) return;
opId = ops[0].opId;
}
const modulePath = window.ipcRenderer.sendSync("getOpDir", { "opId": opId });
if (modulePath)
{
navigator.clipboard.writeText(modulePath);
CABLES.UI.notify("Op path copied to clipboard");
}
}
};

Expand Down

0 comments on commit 7745ead

Please sign in to comment.