aboutsummaryrefslogtreecommitdiffhomepage
path: root/cli
diff options
context:
space:
mode:
authorJohannes Zellner <johannes@cloudron.io>2017-02-09 15:32:31 +0100
committerJohannes Zellner <johannes@cloudron.io>2017-02-09 15:32:31 +0100
commitba93623cc0d9a2147856a1ae1835b146fb160c94 (patch)
tree500954a439f88dbe7ccb2e2d54307b14f150baac /cli
parentf173d2d7a502fba9935d5cd5974fd5af129b29d9 (diff)
downloadSurfer-ba93623cc0d9a2147856a1ae1835b146fb160c94.tar.gz
Surfer-ba93623cc0d9a2147856a1ae1835b146fb160c94.tar.zst
Surfer-ba93623cc0d9a2147856a1ae1835b146fb160c94.zip
Fix cli help output
Diffstat (limited to 'cli')
-rw-r--r--cli/actions.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/cli/actions.js b/cli/actions.js
index 5ad9dc6..996ef7f 100644
--- a/cli/actions.js
+++ b/cli/actions.js
@@ -24,7 +24,7 @@ var gQuery = {};
24 24
25function checkConfig() { 25function checkConfig() {
26 if (!config.server() || !config.accessToken()) { 26 if (!config.server() || !config.accessToken()) {
27 console.log('You have run "login" first'); 27 console.log('Run %s first', 'surfer login'.yellow);
28 process.exit(1); 28 process.exit(1);
29 } 29 }
30 30
@@ -92,9 +92,9 @@ function login(uri) {
92} 92}
93 93
94function logout() { 94function logout() {
95 checkConfig(); 95 if (!config.accessToken()) return console.log('Done'.green);
96 96
97 superagent.post(config.server() + '/api/logout').query(gQuery).end(function (error, result) { 97 superagent.post(config.server() + '/api/logout').query({ access_token: config.accessToken() }).end(function (error, result) {
98 if (result && result.statusCode !== 200) console.log('Failed to logout: ' + result.statusCode); 98 if (result && result.statusCode !== 200) console.log('Failed to logout: ' + result.statusCode);
99 if (error) console.log(error); 99 if (error) console.log(error);
100 100