diff --git a/src/commands/auth/login.js b/src/commands/auth/login.js index 62711ea6..18e3903c 100644 --- a/src/commands/auth/login.js +++ b/src/commands/auth/login.js @@ -23,11 +23,11 @@ function login (opts) { var Registry = require('../../registry') if (opts._[0]) opts.server = opts._[0] - var welcome = output` + var welcome = output(` Welcome to ${chalk.green(`dat`)} program! Login to publish your dats. - ` + `) console.log(welcome) var schema = { @@ -70,13 +70,13 @@ function login (opts) { if (err && err.message) return exitErr(err.message) else if (err) return exitErr(err.toString()) - console.log(output` + console.log(output(` Logged you in to ${chalk.green(opts.server)}! Now you can publish dats and share: * Run ${chalk.green(`dat publish`)} to publish a dat! * View & Share your dats at ${opts.server} - `) + `)) process.exit(0) }) } diff --git a/src/commands/auth/register.js b/src/commands/auth/register.js index f1169beb..169edbed 100644 --- a/src/commands/auth/register.js +++ b/src/commands/auth/register.js @@ -23,11 +23,11 @@ function register (opts) { // TODO: check if logged in? if (opts._[0]) opts.server = opts._[0] - var welcome = output` + var welcome = output(` Welcome to ${chalk.green(`dat`)} program! Create a new account with a Dat registry. - ` + `) console.log(welcome) var schema = { @@ -76,11 +76,11 @@ function register (opts) { }, function (err) { if (err && err.message) return exitErr(err.message) else if (err) return exitErr(err.toString()) - console.log(output` + console.log(output(` Created account on ${chalk.green(opts.server)}! Login to start publishing: ${chalk.green(`dat login`)} - `) + `)) process.exit(0) }) } diff --git a/src/commands/auth/whoami.js b/src/commands/auth/whoami.js index abb5b8ac..534a6e36 100644 --- a/src/commands/auth/whoami.js +++ b/src/commands/auth/whoami.js @@ -28,7 +28,7 @@ function whoami (opts) { if (!opts.server) return exitErr('No login information found.') return exitErr('No login information found for that server.') } - console.log(output` + console.log(output(` Your active Dat registry information: --- @@ -39,7 +39,7 @@ function whoami (opts) { Change your registry by logging in again: ${chalk.dim.green('dat login ')} - `) + `)) process.exit(0) } diff --git a/src/commands/publish.js b/src/commands/publish.js index 1936609f..c24d75a9 100644 --- a/src/commands/publish.js +++ b/src/commands/publish.js @@ -34,7 +34,7 @@ function publish (opts) { var client = Registry(opts) var whoami = client.whoami() if (!whoami || !whoami.token) { - var loginErr = output` + var loginErr = output(` Welcome to ${chalk.green(`dat`)} program! Publish your dats to ${chalk.green(opts.server)}. @@ -45,7 +45,7 @@ function publish (opts) { ${chalk.green('dat register')} Explore public dats at ${chalk.blue('datbase.org/explore')} - ` + `) return exitErr(loginErr) } @@ -69,10 +69,10 @@ function publish (opts) { title: opts.title, description: opts.description }, data) - var welcome = output` + var welcome = output(` Publishing dat to ${chalk.green(opts.server)}! - ` + `) console.log(welcome) if (datInfo.name) return makeRequest(datInfo) @@ -101,9 +101,9 @@ function publish (opts) { if (err) { if (err.message) { if (err.message === 'timed out') { - return exitErr(output`${chalk.red('\nERROR: ' + opts.server + ' could not connect to your computer.')} + return exitErr(output(`${chalk.red('\nERROR: ' + opts.server + ' could not connect to your computer.')} Troubleshoot here: ${chalk.green('https://docs.datproject.org/troubleshooting#networking-issues')} - `) + `)) } var str = err.message.trim() if (str === 'jwt expired') return exitErr(`Session expired, please ${chalk.green('dat login')} again`) @@ -118,26 +118,26 @@ function publish (opts) { datjson.write(datInfo, function (err) { if (err) return exitErr(err) // TODO: write published url to dat.json (need spec) - var msg = output` + var msg = output(` We ${body.updated === 1 ? 'updated' : 'published'} your dat! ${chalk.blue.underline(`${opts.server}/${whoami.username}/${datInfo.name}`)} - `// TODO: get url back? it'd be better to confirm link than guess username/datname structure + `)// TODO: get url back? it'd be better to confirm link than guess username/datname structure console.log(msg) if (body.updated === 1) { - console.log(output` + console.log(output(` ${chalk.dim.green('Cool fact #21')} ${opts.server} will live update when you are sharing your dat! You only need to publish again if your dat link changes. - `) + `)) } else { - console.log(output` + console.log(output(` Remember to use ${chalk.green('dat share')} before sharing. This will make sure your dat is available. - `) + `)) } process.exit(0) }) diff --git a/src/commands/unpublish.js b/src/commands/unpublish.js index e86566ad..1157a4b5 100644 --- a/src/commands/unpublish.js +++ b/src/commands/unpublish.js @@ -31,12 +31,12 @@ function unpublish (opts) { var client = Registry(opts) var whoami = client.whoami() if (!whoami || !whoami.token) { - var loginErr = output` + var loginErr = output(` Welcome to ${chalk.green(`dat`)} program! ${chalk.bold('You must login before unpublishing.')} ${chalk.green('dat login')} - ` + `) return exitErr(loginErr) }