Skip to content

Commit e4375fd

Browse files
committed
Prevent value from being interpolated by the shell when copying.
1 parent a61459b commit e4375fd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/bang.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/bang.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ module.exports = class Bang
7171

7272
copy: (value) ->
7373
copyCommand = if os.type().match /darwin/i then "pbcopy" else "xclip -selection clipboard"
74-
exec "printf #{value} | #{copyCommand}", (error, stdout, stderr) ->
74+
exec "printf '#{value.replace(/\'/g, "\\'")}' | #{copyCommand}", (error, stdout, stderr) ->
7575
throw error if error
7676

7777
pad: (item, amount) ->

0 commit comments

Comments
 (0)