We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 252fa15 commit 0eda6b1Copy full SHA for 0eda6b1
1 file changed
menu/paste-to-clip.js
@@ -0,0 +1,22 @@
1
+export const pasteToClip = async ({CloudCmd, DOM}) => {
2
+ const value = await navigator.clipboard.readText();
3
+ const encoded = btoa(encodeURIComponent(`${value}\n`));
4
+
5
+ const command = [
6
+ 'export $CLIP=',
7
+ 'node',
8
+ '-e',
9
+ `'process.stdout.write(decodeURIComponent(atob("${encoded}")));'`,
10
+ '>',
11
+ ].join(' ');
12
13
+ const {TerminalRun, config} = CloudCmd;
14
+ const cwd = config('root') + DOM.CurrentInfo.dirPath;
15
16
+ return await TerminalRun.show({
17
+ cwd,
18
+ command,
19
+ closeMessage: 'Press any key to close Terminal',
20
+ autoClose: false,
21
+ });
22
+};
0 commit comments