Browse Source

Add header to alias and secrets command

master
Olli Vanhoja 8 years ago
parent
commit
87c4b1fc16
  1. 5
      bin/now-alias
  2. 5
      bin/now-secrets

5
bin/now-alias

@ -126,7 +126,8 @@ async function run (token) {
aliases.sort((a, b) => new Date(b.created) - new Date(a.created));
const current = new Date();
const text = table(aliases.map((_alias) => {
const header = [['', 'id', 'source', 'url', 'created'].map(s => chalk.dim(s))];
const text = table(header.concat(aliases.map((_alias) => {
const _url = chalk.underline(`https://${_alias.alias}`);
const target = _alias.deploymentId;
const _sourceUrl = urls.get(target)
@ -143,7 +144,7 @@ async function run (token) {
_url,
time
];
}), { align: ['l', 'r', 'l', 'l'], hsep: ' '.repeat(2), stringLength: strlen });
})), { align: ['l', 'r', 'l', 'l'], hsep: ' '.repeat(2), stringLength: strlen });
const elapsed_ = ms(new Date() - start_);
console.log(`> ${aliases.length} alias${aliases.length > 1 ? 'es' : ''} found ${chalk.gray(`[${elapsed_}]`)}`);

5
bin/now-secrets

@ -113,14 +113,15 @@ async function run (token) {
const elapsed = ms(new Date() - start);
console.log(`> ${list.length} secret${list.length > 1 ? 's' : ''} found ${chalk.gray(`[${elapsed}]`)}`);
const cur = Date.now();
const out = table(list.map((secret) => {
const header = [['', 'id', 'name', 'created'].map(s => chalk.dim(s))];
const out = table(header.concat(list.map((secret) => {
return [
'',
secret.uid,
chalk.bold(secret.name),
chalk.gray(ms(cur - new Date(secret.created)) + ' ago')
];
}), { align: ['l', 'r', 'l'], hsep: ' '.repeat(2), stringLength: strlen });
})), { align: ['l', 'r', 'l', 'l'], hsep: ' '.repeat(2), stringLength: strlen });
if (out) console.log('\n' + out + '\n');
return secrets.close();
}

Loading…
Cancel
Save