copy-paste
Advanced tools
Comparing version 1.0.3 to 1.0.4
12
index.js
@@ -75,6 +75,6 @@ var child_process = require("child_process"); | ||
}; | ||
console.log("config.encoding: " + config.encoding); | ||
var pasteCommand = [ config.paste.command ].concat(config.paste.args).join(" "); | ||
exports.paste = function(callback) { | ||
if(execSync && !callback) { return execSync(pasteCommand).toString(config.encoding) + "uuufff"; } | ||
if(execSync && !callback) { return execSync(pasteCommand); } | ||
else if(callback) { | ||
@@ -87,4 +87,4 @@ var child = spawn(config.paste.command, config.paste.args); | ||
child.stdin.setEncoding(config.encoding); | ||
child.stderr.setEncoding(config.encoding); | ||
child.stdin.setEncoding("utf8"); | ||
child.stderr.setEncoding("utf8"); | ||
@@ -94,5 +94,3 @@ child.on("error", function(err) { done(err); }); | ||
.on("data", function(chunk) { data.push(chunk); }) | ||
.on("end", function() { | ||
done(null, Buffer.concat(data).toString("iso8859") + "hiihi"); | ||
}) | ||
.on("end", function() { done(null, data.join("")); }) | ||
; | ||
@@ -99,0 +97,0 @@ child.stderr |
{ "name": "copy-paste" | ||
, "version": "1.0.3" | ||
, "version": "1.0.4" | ||
, "description": "A command line utility that allows read/write (i.e copy/paste) access to the system clipboard." | ||
@@ -4,0 +4,0 @@ , "keywords": [ "copy", "paste", "copy and paste", "clipboard" ] |
6795
107