Browse Source

add totals to listings and fix plurals

master
Guillermo Rauch 8 years ago
parent
commit
c4248cebaa
  1. 3
      bin/now-alias
  2. 3
      bin/now-domains
  3. 4
      bin/now-list
  4. 2
      bin/now-secrets

3
bin/now-alias

@ -118,6 +118,7 @@ async function run (token) {
return exit(1);
}
const start_ = new Date();
const list = await alias.list();
const urls = new Map(list.map(l => [l.uid, l.url]));
const aliases = await alias.ls();
@ -143,6 +144,8 @@ async function run (token) {
];
}), { align: ['l', 'r', 'l'], hsep: ' '.repeat(3) });
const elapsed_ = ms(new Date() - start_);
console.log(`> ${list.length} alias${list.length > 1 ? 'es' : ''} found ${chalk.gray(`[${elapsed_}]`)}`);
if (text) console.log('\n' + text + '\n');
break;

3
bin/now-domains

@ -123,6 +123,7 @@ async function run (token) {
return exit(1);
}
const start_ = new Date();
const domains = await domain.ls();
domains.sort((a, b) => new Date(b.created) - new Date(a.created));
const current = new Date();
@ -137,6 +138,8 @@ async function run (token) {
];
}), { align: ['l', 'r', 'l'], hsep: ' '.repeat(3) });
const elapsed_ = ms(new Date() - start_);
console.log(`> ${domains.length} domain${domains.length > 1 ? 's' : ''} found ${chalk.gray(`[${elapsed_}]`)}`);
if (out) console.log('\n' + out + '\n');
break;

4
bin/now-list

@ -75,6 +75,7 @@ Promise.resolve(argv.token || config.token || login(apiUrl))
async function list (token) {
const now = new Now(apiUrl, token, { debug });
const start = new Date();
let deployments;
try {
@ -103,7 +104,8 @@ async function list (token) {
}), { align: ['l', 'r', 'l'], hsep: ' '.repeat(6) });
return chalk.bold(name) + '\n\n' + indent(t, 2);
}).join('\n\n');
const elapsed = ms(new Date() - start);
console.log(`> ${deployments.length} deployment${deployments.length > 1 ? 's' : ''} found ${chalk.gray(`[${elapsed}]`)}`);
if (text) console.log('\n' + text + '\n');
}

2
bin/now-secrets

@ -109,7 +109,7 @@ async function run (token) {
}
const list = await secrets.ls();
const elapsed = ms(new Date() - start);
console.log(`> ${list.length} secrets found ${chalk.gray(`[${elapsed}]`)}`);
console.log(`> ${list.length} secret${list.length > 1 ? 's' : ''} found ${chalk.gray(`[${elapsed}]`)}`);
const cur = Date.now();
const out = table(list.map((secret) => {
return [

Loading…
Cancel
Save