summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xclient.js17
-rw-r--r--package-lock.json52
-rw-r--r--package.json6
3 files changed, 61 insertions, 14 deletions
diff --git a/client.js b/client.js
index 7fd765c..5313b0a 100755
--- a/client.js
+++ b/client.js
@@ -4,9 +4,9 @@ var fs=require("fs"),
path=require("path"),
https=require("https"),
crypto=require("crypto"),
- dialog=require("dialog"),
kbd=require("kbd"),
- toClipboard=require("to-clipboard");
+ toClipboard=require("to-clipboard"),
+ notifier=require("node-notifier");
var HOSTNAME=process.argv[2]||"tomsmeding.com",HTTPSPORT=443;
console.log("Using server "+HOSTNAME);
@@ -49,6 +49,13 @@ var ignored=[];
var currentState=[];
+function notify(message) {
+ notifier.notify({
+ title: "serverstore",
+ message: message,
+ });
+}
+
//lots of code taken/modified from tomsmeding/gvajnez
function collectDirState(dir){
if(!dir)dir=directory;
@@ -141,7 +148,7 @@ function getchallenge(cb){
});
res.on("end",function(){
if(res.statusCode!=200){
- dialog.warn("Could not request challenge! Is your internet connection alive?\n\n"+body);
+ notify("Could not request challenge! Is your internet connection alive?\n"+body);
return;
}
console.log("challenge = "+body);
@@ -176,12 +183,12 @@ function sendfile(fname,retries){
res.on("end",function(){
if(res.statusCode!=200){
if(retries>0)sendfile(fname,retries-1);
- else dialog.warn("Could not upload image! Are your credentials still okay?\n\n"+body);
+ else notify("Could not upload image! Are your credentials still okay?\n"+body);
return;
}
console.log("Successful upload");
toClipboard.sync(body.trim());
- dialog.info(body+"\n(Copied to clipboard.)");
+ notify("Uploaded, link copied");
try {
fs.unlinkSync(fname);
} catch(e){
diff --git a/package-lock.json b/package-lock.json
index e48742e..3be6940 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "serverstore",
- "version": "1.0.0",
+ "version": "1.0.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -166,11 +166,6 @@
}
}
},
- "dialog": {
- "version": "0.1.8",
- "resolved": "https://registry.npmjs.org/dialog/-/dialog-0.1.8.tgz",
- "integrity": "sha1-AehPPDw+HHHfvh44EZpzpg1pOV8="
- },
"express": {
"version": "4.16.3",
"resolved": "https://registry.npmjs.org/express/-/express-4.16.3.tgz",
@@ -545,6 +540,21 @@
}
}
},
+ "growly": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz",
+ "integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE="
+ },
+ "is-wsl": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz",
+ "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0="
+ },
+ "isexe": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
+ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA="
+ },
"kbd": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/kbd/-/kbd-0.1.0.tgz",
@@ -560,6 +570,18 @@
}
}
},
+ "node-notifier": {
+ "version": "5.4.0",
+ "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-5.4.0.tgz",
+ "integrity": "sha512-SUDEb+o71XR5lXSTyivXd9J7fCloE3SyP4lSgt3lU2oSANiox+SxlNRGPjDKrwU1YN3ix2KN/VGGCg0t01rttQ==",
+ "requires": {
+ "growly": "^1.3.0",
+ "is-wsl": "^1.1.0",
+ "semver": "^5.5.0",
+ "shellwords": "^0.1.1",
+ "which": "^1.3.0"
+ }
+ },
"node-persist": {
"version": "0.0.8",
"resolved": "https://registry.npmjs.org/node-persist/-/node-persist-0.0.8.tgz",
@@ -586,10 +608,28 @@
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",
"integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg=="
},
+ "semver": {
+ "version": "5.6.0",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz",
+ "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg=="
+ },
+ "shellwords": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz",
+ "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww=="
+ },
"to-clipboard": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/to-clipboard/-/to-clipboard-0.4.0.tgz",
"integrity": "sha1-pSpX+KTVZlVK8LKz++KUM6tH2oI="
+ },
+ "which": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
+ "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
+ "requires": {
+ "isexe": "^2.0.0"
+ }
}
}
}
diff --git a/package.json b/package.json
index 8445fe9..51f362d 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "serverstore",
- "version": "1.0.0",
+ "version": "1.0.1",
"description": "A Puush alternative",
"main": "serverstore.js",
"repository": {
@@ -9,7 +9,7 @@
},
"dependencies": {
"body-parser": "^1.14.1",
- "dialog": "^0.1.8",
+ "node-notifier": "^5.4.0",
"express": "^4.13.3",
"glob": "^5.0.15",
"kbd": "^0.1.0",
@@ -26,6 +26,6 @@
"server",
"screenshot"
],
- "author": "Tom Smeding <hallo@tomsmeding.nl> (http://tomsmeding.com)",
+ "author": "Tom Smeding <tom.smeding@gmail.com> (https://tomsmeding.com)",
"license": "MIT"
}