From efb8da72e73d0bf142d213042ae0bece572106fb Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Sun, 8 Jan 2017 18:29:05 +0700 Subject: [PATCH] Allow shorthand aliases with `now --alias` (#206) --- bin/now-deploy.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/now-deploy.js b/bin/now-deploy.js index 7a57a16..4bcf8af 100755 --- a/bin/now-deploy.js +++ b/bin/now-deploy.js @@ -569,8 +569,14 @@ const assignAlias = async (autoAlias, token, deployment) => { } } - // Throw an error if it doesn't + // If alias doesn't exist if (!related) { + // Check if the uid was actually an alias + if (type === 'uid') { + return assignAlias(`${autoAlias}.now.sh`, token, deployment) + } + + // If not, throw an error const withID = type === 'uid' ? 'with ID ' : '' error(`Alias ${withID}"${autoAlias}" doesn't exist`) return