From ba93623cc0d9a2147856a1ae1835b146fb160c94 Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Thu, 9 Feb 2017 15:32:31 +0100 Subject: Fix cli help output --- cli/actions.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cli') 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 = {}; function checkConfig() { if (!config.server() || !config.accessToken()) { - console.log('You have run "login" first'); + console.log('Run %s first', 'surfer login'.yellow); process.exit(1); } @@ -92,9 +92,9 @@ function login(uri) { } function logout() { - checkConfig(); + if (!config.accessToken()) return console.log('Done'.green); - superagent.post(config.server() + '/api/logout').query(gQuery).end(function (error, result) { + superagent.post(config.server() + '/api/logout').query({ access_token: config.accessToken() }).end(function (error, result) { if (result && result.statusCode !== 200) console.log('Failed to logout: ' + result.statusCode); if (error) console.log(error); -- cgit v1.2.3