Browse Source

now-alias: fix edge case with older aliases or removed deployments

master
Guillermo Rauch 9 years ago
parent
commit
6dcd7b68dd
  1. 14
      bin/now-alias

14
bin/now-alias

@ -128,9 +128,19 @@ async function run (token) {
const text = sorted.map(([target, _aliases]) => {
return table(_aliases.map((_alias) => {
const _url = chalk.underline(`https://${_alias.alias}`);
const _sourceUrl = chalk.underline(`https://${urls.get(target)}`);
const _sourceUrl = urls.get(target)
? chalk.underline(`https://${urls.get(target)}`)
: chalk.gray('<null>');
const time = chalk.gray(ms(current - new Date(_alias.created)) + ' ago');
return [_alias.uid, _sourceUrl, _url, time];
return [
// we default to `''` because some early aliases didn't
// have an uid associated
null == _alias.uid ? '' : _alias.uid,
_sourceUrl,
_url,
time
];
}), { align: ['l', 'r', 'l'], hsep: ' '.repeat(3) });
}).join('\n\n');

Loading…
Cancel
Save