Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removed redundant code.

  • Loading branch information...
commit 200a1c83ebc0972ca904fa9da83541fdb04489ca 1 parent c22101b
Xavi authored
1  index.js
View
@@ -19,7 +19,6 @@ switch(process.platform) {
break;
}
-
GLOBAL.copy = exports.copy = function(text) {
var child = spawn(config.copy.command, config.copy.args);
19 platform/java-fallback.js
View
@@ -1,17 +1,2 @@
-var execSync = require("execSync");
-var spawn = require("child_process").spawn;
-
-exports.copy = function(text) {
- var child = spawn("java", [ "-cp", "./platform/fallbacks", "copy" ]);
-
- child
- .on("exit", function() { console.log("Copy complete"); })
- .stderr.on("data", function(err) { console.error(err.toString()); });
-
- if(text.pipe) { text.pipe(child.stdin); }
- else { child.stdin.end(text); }
-};
-
-exports.paste = function() {
- return execSync.stdout("java -cp ./platform/fallbacks paste");
-};
+exports.copy = { command: "java", args: [ "-cp", "./platform/fallbacks", "copy" ] };
+exports.paste = { command: "java", args: [ "-cp", "./platform/fallbacks", "paste" ] };
19 platform/vbscript-fallback.js
View
@@ -1,17 +1,2 @@
-var execSync = require("execSync");
-var spawn = require("child_process").spawn;
-
-exports.copy = function(text) {
- var child = spawn("cscript", [ "/Nologo", ".\\platform\\fallbacks\\copy.vbs" ]);
-
- child
- .on("exit", function() { console.log("Copy complete??"); })
- .stderr.on("data", function(err) { console.error(err.toString()); });
-
- if(text.pipe) { text.pipe(child.stdin); }
- else { child.stdin.end(text); }
-};
-
-exports.paste = function() {
- return execSync.stdout("cscript /Nologo .\\platform\\fallbacks\\paste.vbs");
-};
+exports.copy = { command: "cscript", args: [ "/Nologo", ".\\platform\\fallbacks\\copy.vbs" ] };
+exports.paste = { command: "cscript", args: [ "/Nologo", ".\\platform\\fallbacks\\paste.vbs" ] };
19 platform/xclip-fallback.js
View
@@ -1,17 +1,2 @@
-var execSync = require("execSync");
-var spawn = require("child_process").spawn;
-
-exports.copy = function(text) {
- var child = spawn("xclip", [ "-selection", "clipboard" ]);
-
- child
- .on("exit", function() { console.log("Copy complete"); })
- .stderr.on("data", function(err) { console.error(err.toString()); });
-
- if(text.pipe) { text.pipe(child.stdin); }
- else { child.stdin.end(text); }
-};
-
-exports.paste = function() {
- return execSync.stdout("xclip -selection clipboard -o");
-};
+exports.copy = { command: "xclip", args: [ "-selection", "clipboard" ] };
+exports.paste = { command: "xclip", args: [ "-selection", "clipboard", "-o" ] };
19 platform/xsel-fallback.js
View
@@ -1,17 +1,2 @@
-var execSync = require("execSync");
-var spawn = require("child_process").spawn;
-
-exports.copy = function(text) {
- var child = spawn("xsel", [ "--clipboard", "--input" ]);
-
- child
- .on("exit", function() { console.log("Copy complete"); })
- .stderr.on("data", function(err) { console.error(err.toString()); });
-
- if(text.pipe) { text.pipe(child.stdin); }
- else { child.stdin.end(text); }
-};
-
-exports.paste = function() {
- return execSync.stdout("xsel --clipboard --output");
-};
+exports.copy = { command: "xsel", args: [ "--clipboard", "--input" ] };
+exports.paste = { command: "xsel", args: [ "--clipboard", "--output" ] };
Please sign in to comment.
Something went wrong with that request. Please try again.