Commit 38932f15 by Girish Ramakrishnan

Add https:// to --server if required

1 parent f14ea69e
Showing with 8 additions and 1 deletions
...@@ -29,12 +29,19 @@ function checkConfig(options) { ...@@ -29,12 +29,19 @@ function checkConfig(options) {
process.exit(1); process.exit(1);
} }
if (options.parent.server) {
var tmp = url.parse(options.parent.server);
if (!tmp.slashes) tmp = url.parse('https://' + options.parent.server);
gServer = tmp.protocol + '//' + tmp.host;
} else {
gServer = config.server();
}
if (!options.parent.token && !config.accessToken()) { if (!options.parent.token && !config.accessToken()) {
console.log('Run %s first or provide %s', 'surfer login'.bold, '--token <access token>'.bold); console.log('Run %s first or provide %s', 'surfer login'.bold, '--token <access token>'.bold);
process.exit(1); process.exit(1);
} }
gServer = options.parent.server || config.server();
gQuery = { access_token: options.parent.token || config.accessToken() }; gQuery = { access_token: options.parent.token || config.accessToken() };
console.error('Using server %s', gServer.cyan); console.error('Using server %s', gServer.cyan);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!