@ -307,7 +307,7 @@ async function run({ token, config: { currentTeam, user } }) {
}
default: {
if (argv._.length === 0) {
await reAlias(token, null, null, help, exit, apiUrl, debug, alias)
await reAlias(token, null, null, help, exit, apiUrl, debug, alias, currentTeam, user)
break
@ -320,7 +320,9 @@ async function run({ token, config: { currentTeam, user } }) {
exit,
apiUrl,
debug,
alias
alias,
currentTeam,
user
)
@ -720,13 +720,13 @@ function printLogs(host, token, currentTeam) {
for (const alias of aliasList) {
assignments.push(
assignAlias(alias, token, host, apiUrl, debug, currentTeam)
assignAlias(alias, token, host, apiUrl, debug, currentTeam, user)
await Promise.all(assignments)
} else {
await reAlias(token, host, null, help, exit, apiUrl, debug)
await reAlias(token, host, null, help, exit, apiUrl, debug, currentTeam, user)
@ -9,6 +9,7 @@ const chalk = require('chalk')
const { error } = require('./error')
const readMetaData = require('./read-metadata')
const NowAlias = require('./alias')
const NowDomains = require('./domains')
exports.assignAlias = async (
autoAlias,
@ -16,15 +17,17 @@ exports.assignAlias = async (
deployment,
currentTeam
) => {
const aliases = new NowAlias({ apiUrl, token, debug, currentTeam })
const domains = new NowDomains({apiUrl, token, debug, currentTeam})
console.log(
`> Assigning alias ${chalk.bold.underline(autoAlias)} to deployment...`
// Assign alias
await aliases.set(String(deployment), String(autoAlias))
await aliases.set(String(deployment), String(autoAlias), domains, currentTeam, user)
exports.reAlias = async (
@ -35,7 +38,9 @@ exports.reAlias = async (
const path = process.cwd()
@ -112,7 +117,8 @@ exports.reAlias = async (
host,
alias.currentTeam