diff options
author | tomsmeding <tom.smeding@gmail.com> | 2016-01-21 17:42:38 +0100 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2016-01-21 17:42:38 +0100 |
commit | 9a432dc4bdd827ea42a46fae8bb7cdd02dd8b19d (patch) | |
tree | b45f6cb1779877cd21b1b0b5f98d1b8bec71c5bb | |
parent | d8bf5919a86a15da4385fcf1f049a3ec0cc47dcf (diff) |
:crocodile:
-rwxr-xr-x | client.js | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -8,7 +8,7 @@ var fs=require("fs"), kbd=require("kbd"), toClipboard=require("to-clipboard"); -var HOSTNAME=process.argv[2]||"tomsmeding.nl",HTTPPORT=42420; +var HOSTNAME=process.argv[2]||"tomsmeding.com",HTTPPORT=42420; console.log("Using server "+HOSTNAME); @@ -177,13 +177,13 @@ function sendfile(fname,retries){ } } console.log("Successful upload"); - setTimeout(function(){ - fs.unlink(fname,function(err){ //not sync, take your time - if(err)console.log(err); - }); - },200); toClipboard.sync(body.trim()); dialog.info(body+"\n(Copied to clipboard.)"); + try { + fs.unlinkSync(fname); + } catch(e){ + console.log(e); + } }); }); req.on("error",function(err){ |