Skip to content

Commit 5543f35

Browse files
committed
fix: Replace copy-paste by clipboardy for security concearns
1 parent 5d709c0 commit 5543f35

File tree

3 files changed

+21
-16
lines changed

3 files changed

+21
-16
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
},
5454
"main": "./src/main.js",
5555
"dependencies": {
56-
"copy-paste": "^1.3.0",
56+
"clipboardy": "^2.1.0",
5757
"diff2html": "^2.7.0",
5858
"extend": "^3.0.2",
5959
"open": "^6.0.0",

src/cli.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
var utils = require('./utils.js').Utils;
1818

1919
var open = require('open');
20-
var ncp = require('copy-paste');
20+
var clipboardy = require('clipboardy');
2121

2222
function Diff2HtmlInterface() {
2323
}
@@ -163,9 +163,8 @@
163163
open(response.url);
164164
return callback(null, response.url);
165165
} else if (postType === 'pbcopy') {
166-
ncp.copy(response.url, function() {
167-
return callback(null, response.url);
168-
});
166+
clipboardy.writeSync(response.url);
167+
return callback(null, response.url);
169168
}
170169
} else {
171170
log.error('Error: ' + response.statusCode);

yarn.lock

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,11 @@ append-transform@^1.0.0:
178178
dependencies:
179179
default-require-extensions "^2.0.0"
180180

181+
arch@^2.1.1:
182+
version "2.1.1"
183+
resolved "https://registry.yarnpkg.com/arch/-/arch-2.1.1.tgz#8f5c2731aa35a30929221bb0640eed65175ec84e"
184+
integrity sha512-BLM56aPo9vLLFVa8+/+pJLnrZ7QGGTVHWsCwieAWT9o9K8UeGaQbzZbGoabWLOo2ksBCztoXdqBZBplqLDDCSg==
185+
181186
archy@^1.0.0:
182187
version "1.0.0"
183188
resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40"
@@ -313,6 +318,14 @@ cli-width@^2.0.0:
313318
resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639"
314319
integrity sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=
315320

321+
clipboardy@^2.1.0:
322+
version "2.1.0"
323+
resolved "https://registry.yarnpkg.com/clipboardy/-/clipboardy-2.1.0.tgz#0123a0c8fac92f256dc56335e0bb8be97a4909a5"
324+
integrity sha512-2pzOUxWcLlXWtn+Jd6js3o12TysNOOVes/aQfg+MT/35vrxWzedHlLwyoJpXjsFKWm95BTNEcMGD9+a7mKzZkQ==
325+
dependencies:
326+
arch "^2.1.1"
327+
execa "^1.0.0"
328+
316329
cliui@^4.0.0:
317330
version "4.1.0"
318331
resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49"
@@ -388,13 +401,6 @@ convert-source-map@^1.6.0:
388401
dependencies:
389402
safe-buffer "~5.1.1"
390403

391-
copy-paste@^1.3.0:
392-
version "1.3.0"
393-
resolved "https://registry.yarnpkg.com/copy-paste/-/copy-paste-1.3.0.tgz#a7e6c4a1c28fdedf2b081e72b97df2ef95f471ed"
394-
integrity sha1-p+bEocKP3t8rCB5yuX3y75X0ce0=
395-
dependencies:
396-
iconv-lite "^0.4.8"
397-
398404
399405
version "1.0.2"
400406
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
@@ -463,9 +469,9 @@ delayed-stream@~1.0.0:
463469
integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk=
464470

465471
diff2html@^2.7.0:
466-
version "2.11.0"
467-
resolved "https://registry.yarnpkg.com/diff2html/-/diff2html-2.11.0.tgz#6b5795053ccc8a59692552c1fb7814bc2d330ef4"
468-
integrity sha512-C1XvaK6w9AAWn1jQekmrrEzMo9ncUvpt4zHaFp40+j3XdtPc+EORngt+xodDz+HBU34eGFswGIoYyGFjlPahJQ==
472+
version "2.11.2"
473+
resolved "https://registry.yarnpkg.com/diff2html/-/diff2html-2.11.2.tgz#f3f27c6b81a75b5a8a3cfb7ae2fda2127290c809"
474+
integrity sha512-FKDFFXW0cHyt+joiYeyWxbcLWZsQYeYRRrHKWZEvu+XMFMM1ChxTkGhET53zAU0tvVjyRRxRjUcrn5ImSqD0ZQ==
469475
dependencies:
470476
diff "^4.0.1"
471477
hogan.js "^3.0.2"
@@ -893,7 +899,7 @@ http-signature@~1.2.0:
893899
jsprim "^1.2.2"
894900
sshpk "^1.7.0"
895901

896-
iconv-lite@^0.4.24, iconv-lite@^0.4.8:
902+
iconv-lite@^0.4.24:
897903
version "0.4.24"
898904
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"
899905
integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==

0 commit comments

Comments
 (0)