diff --git a/bin/now-alias b/bin/now-alias index 593f54c..809be5a 100755 --- a/bin/now-alias +++ b/bin/now-alias @@ -156,7 +156,7 @@ async function run (token) { } try { - const confirmation = (await readConfirmation(_alias)).toLowerCase(); + const confirmation = (await readConfirmation(alias, _alias)).toLowerCase(); if ('y' !== confirmation && 'yes' !== confirmation) { console.log('\n> Aborted'); process.exit(0); @@ -226,11 +226,15 @@ function indent (text, n) { return text.split('\n').map((l) => ' '.repeat(n) + l).join('\n'); } -function readConfirmation (_alias) { +async function readConfirmation (alias, _alias) { + const list = await alias.list(); + const urls = new Map(list.map(l => [l.uid, l.url])); + return new Promise((resolve, reject) => { const time = chalk.gray(ms(new Date() - new Date(_alias.created)) + ' ago'); + const _sourceUrl = chalk.underline(`https://${urls.get(_alias.deploymentId)}`); const tbl = table( - [[_alias.uid, `https://${_alias.alias}`, time]], + [[_alias.uid, _sourceUrl, chalk.underline(`https://${_alias.alias}`), time]], { align: ['l', 'r', 'l'], hsep: ' '.repeat(6) } ); diff --git a/bin/now-remove b/bin/now-remove index a0422de..9f8475a 100755 --- a/bin/now-remove +++ b/bin/now-remove @@ -55,7 +55,7 @@ function readConfirmation (app) { return new Promise((resolve, reject) => { const time = chalk.gray(ms(new Date() - app.created) + ' ago'); const tbl = table( - [[app.uid, `https://${app.url}`, time]], + [[app.uid, chalk.underline(`https://${app.url}`), time]], { align: ['l', 'r', 'l'], hsep: ' '.repeat(6) } );