aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--cli/actions.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/cli/actions.js b/cli/actions.js
index e5d1731..0c621f6 100644
--- a/cli/actions.js
+++ b/cli/actions.js
@@ -29,12 +29,19 @@ function checkConfig(options) {
29 process.exit(1); 29 process.exit(1);
30 } 30 }
31 31
32 if (options.parent.server) {
33 var tmp = url.parse(options.parent.server);
34 if (!tmp.slashes) tmp = url.parse('https://' + options.parent.server);
35 gServer = tmp.protocol + '//' + tmp.host;
36 } else {
37 gServer = config.server();
38 }
39
32 if (!options.parent.token && !config.accessToken()) { 40 if (!options.parent.token && !config.accessToken()) {
33 console.log('Run %s first or provide %s', 'surfer login'.bold, '--token <access token>'.bold); 41 console.log('Run %s first or provide %s', 'surfer login'.bold, '--token <access token>'.bold);
34 process.exit(1); 42 process.exit(1);
35 } 43 }
36 44
37 gServer = options.parent.server || config.server();
38 gQuery = { access_token: options.parent.token || config.accessToken() }; 45 gQuery = { access_token: options.parent.token || config.accessToken() };
39 46
40 console.error('Using server %s', gServer.cyan); 47 console.error('Using server %s', gServer.cyan);