Comparing version 0.1.1 to 0.1.2
(function() { | ||
var Bang, Command, exec, fs, os, path; | ||
var Bang, Command, exec, fs, path; | ||
var __slice = Array.prototype.slice; | ||
@@ -13,4 +13,2 @@ | ||
os = require("os"); | ||
module.exports = Bang = (function() { | ||
@@ -25,3 +23,3 @@ | ||
program = new Command; | ||
program.version("0.1.1").usage("[options] [key] [value]").option("-d, --delete", "delete the specified key").option("-h, --help", "get help").parse(args); | ||
program.version("0.1.2").usage("[options] [key] [value]").option("-d, --delete", "delete the specified key").option("-h, --help", "get help").parse(args); | ||
_ref = program.args, key = _ref[0], value = _ref[1]; | ||
@@ -99,6 +97,17 @@ if (program.help) { | ||
var copyCommand; | ||
copyCommand = os.type().match(/darwin/i) ? "pbcopy" : "xclip -selection clipboard"; | ||
exec("printf '" + (value.replace(/\'/g, "\\'")) + "' | " + copyCommand, function(error, stdout, stderr) { | ||
if (error) throw error; | ||
}); | ||
copyCommand = (function() { | ||
switch (process.platform) { | ||
case "darwin": | ||
return "pbcopy"; | ||
case "win32": | ||
return "clip"; | ||
default: | ||
return "xclip -selection clipboard"; | ||
} | ||
})(); | ||
if (process.platform === "win32") { | ||
exec("echo " + (value.replace(/\'/g, "\\'")) + " | " + copyCommand); | ||
} else { | ||
exec("printf '" + (value.replace(/\'/g, "\\'")) + "' | " + copyCommand); | ||
} | ||
return this; | ||
@@ -105,0 +114,0 @@ }; |
@@ -5,3 +5,3 @@ { | ||
"description": "Text snippets on the command line.", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"homepage": "https://github.com/jimmycuadra/bang", | ||
@@ -8,0 +8,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
35161
291
1