|
@ -18,6 +18,21 @@ export default class Alias extends Now { |
|
|
return body.aliases; |
|
|
return body.aliases; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async rm (alias) { |
|
|
|
|
|
const res = await this._fetch(`/now/aliases/${alias}`, { |
|
|
|
|
|
method: 'DELETE' |
|
|
|
|
|
}); |
|
|
|
|
|
const body = await res.json(); |
|
|
|
|
|
|
|
|
|
|
|
if (res.status !== 200) { |
|
|
|
|
|
const err = new Error('Deletion failed ' + body); |
|
|
|
|
|
err.userError = true; |
|
|
|
|
|
throw err; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
console.log(`${chalk.cyan('> Success!')}`); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
async set (deployment, alias) { |
|
|
async set (deployment, alias) { |
|
|
const list = await this.list(); |
|
|
const list = await this.list(); |
|
|
let key, val; |
|
|
let key, val; |
|
|