From fb03bd6c21434f0ccc59eb8add68ee5ab82cc747 Mon Sep 17 00:00:00 2001 From: Leo Lamprecht Date: Sat, 28 Jan 2017 11:09:44 +0100 Subject: [PATCH] Allow the `alias` field to be an array --- bin/now-alias.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/now-alias.js b/bin/now-alias.js index 4814f5f..a958336 100755 --- a/bin/now-alias.js +++ b/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) + } }