Browse Source

Hide scale settings for static deploys

master
Tony Kovanen 8 years ago
parent
commit
4763e4cbff
  1. 14
      bin/now-list.js

14
bin/now-list.js

@ -144,7 +144,9 @@ async function list({ token, config: { currentTeam, user } }) {
return Math.max(acc, (i.url && i.url.length) || 0)
}, 0) + 5
const timeNow = new Date()
console.log(`> ${deployments.length} deployment${deployments.length === 1 ? '' : 's'} found under ${chalk.bold((currentTeam && currentTeam.slug) || user.username || user.email)} ${chalk.grey('[' + ms(timeNow - start) + ']')}`)
console.log(
`> ${deployments.length} deployment${deployments.length === 1 ? '' : 's'} found under ${chalk.bold((currentTeam && currentTeam.slug) || user.username || user.email)} ${chalk.grey('[' + ms(timeNow - start) + ']')}`
)
let shouldShowAllInfo = false
for (const app of apps) {
@ -158,12 +160,16 @@ async function list({ token, config: { currentTeam, user } }) {
}
}
if (!argv.all && shouldShowAllInfo) {
console.log(`> To expand the list and see instances run ${chalk.cyan('`now ls --all [app]`')}`)
console.log(
`> To expand the list and see instances run ${chalk.cyan('`now ls --all [app]`')}`
)
}
console.log()
sorted.forEach(([name, deps]) => {
const listedDeployments = argv.all ? deps : deps.slice(0, 5)
console.log(`${chalk.bold(name)} ${chalk.gray('(' + listedDeployments.length + ' of ' + deps.length + ' total)')}`)
console.log(
`${chalk.bold(name)} ${chalk.gray('(' + listedDeployments.length + ' of ' + deps.length + ' total)')}`
)
const urlSpec = `%-${urlLength}s`
console.log(
printf(
@ -198,7 +204,7 @@ async function list({ token, config: { currentTeam, user } }) {
printf(
spec,
chalk.underline(dep.url),
dep.scale.current,
dep.scale ? dep.scale.current : '✖',
state,
ms(timeNow - dep.created)
)

Loading…
Cancel
Save