Skip to content

Commit

Permalink
Allow the alias field to be an array
Browse files Browse the repository at this point in the history
  • Loading branch information
leo committed Jan 28, 2017
1 parent bde79db commit fb03bd6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions bin/now-alias.js
Expand Up @@ -301,16 +301,18 @@ 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)
}

// 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)
}
}

0 comments on commit fb03bd6

Please sign in to comment.