Browse Source

Allow the `alias` field to be an array

master
Leo Lamprecht 8 years ago
parent
commit
fb03bd6c21
No known key found for this signature in database GPG Key ID: B08517883D5E0E10
  1. 8
      bin/now-alias.js

8
bin/now-alias.js

@ -301,10 +301,10 @@ async function realias(alias) {
quiet: true // `quiet`
})
const target = nowConfig && nowConfig.alias
const targets = nowConfig && nowConfig.alias
// the user never intended to support aliases from the package
if (!target) {
if (!targets || !Array.isArray(targets)) {
help()
return exit(0)
}
@ -312,5 +312,7 @@ async function realias(alias) {
// now try to find the last deployment
const source = await alias.last(name)
await alias.set(source.url, target)
for (const target of targets) {
await alias.set(source.url, target)
}
}

Loading…
Cancel
Save