summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortomsmeding <hallo@tomsmeding.nl>2015-08-29 11:16:50 +0200
committertomsmeding <hallo@tomsmeding.nl>2015-08-29 11:16:50 +0200
commit5a9bb42ee6cb7d46cbd9c84ae24f75e05392d0f0 (patch)
treeca8531abc26a8c1e5518c49db691c1c08f7bfd3c
parentaba1fbae35b4e645bb296f6b6205b4cfb623835e (diff)
Clipboard and hostname in argument
-rwxr-xr-xclient.js9
-rw-r--r--package.json5
2 files changed, 9 insertions, 5 deletions
diff --git a/client.js b/client.js
index 00d4abb..ef1812e 100755
--- a/client.js
+++ b/client.js
@@ -5,9 +5,11 @@ var fs=require("fs"),
http=require("http"),
crypto=require("crypto"),
dialog=require("dialog"),
- kbd=require("kbd");
+ kbd=require("kbd"),
+ toClipboard=require("to-clipboard");
-var HOSTNAME="localhost",HTTPPORT=42420;
+var HOSTNAME=process.argv[2]||"tomsmeding.nl",HTTPPORT=42420;
+console.log("Using server "+HOSTNAME);
var userid="0",password="-";
@@ -150,7 +152,8 @@ function sendfile(fname,retries){
}
console.log("Successful upload");
fs.unlink(fname); //not sync, take your time
- dialog.info(body);
+ toClipboard.sync(body.trim());
+ dialog.info(body+"\n(Copied to clipboard.)");
});
});
req.on("error",function(err){
diff --git a/package.json b/package.json
index c422f7d..af0f888 100644
--- a/package.json
+++ b/package.json
@@ -11,9 +11,10 @@
"body-parser": "^1.13.3",
"dialog": "^0.1.8",
"express": "^4.13.3",
- "kbd": "^0.0.8",
"glob": "^5.0.14",
- "node-persist": "^0.0.6"
+ "kbd": "^0.0.8",
+ "node-persist": "^0.0.6",
+ "to-clipboard": "^0.1.0"
},
"devDependencies": {},
"scripts": {