@ -115,6 +115,8 @@ export default class Alias extends Now {
}
asyncset(deployment,alias){
alias=alias.toLowerCase();
constdepl=awaitthis.findDeployment(deployment);
if(!depl){
consterr=newError(`Deployment not found by "${deployment}". Run ${chalk.dim('`now ls`')} to see your deployments.`);
@ -130,11 +132,17 @@ export default class Alias extends Now {
alias=toHost(alias);
}
if(!/\.now\.sh$/.test(alias)){
console.log(`> ${chalk.bold(chalk.underline(alias))} is a custom domain.`);
console.log(`> Verifying that ${chalk.bold(chalk.underline(alias))} has a ${chalk.dim('`CNAME`')} or ${chalk.dim('`ALIAS`')} record pointing to ${chalk.bold(chalk.underline('alias.zeit.co'))}.`);
awaitthis.verifyOwnership(alias);
}
awaitthis.createAlias(depl,alias);
console.log(`${chalk.cyan('> Success!')} Deployment ${chalk.bold(`https://${depl.url}`)}${chalk.dim(`(${depl.uid})`)} now points to ${chalk.bold(chalk.underline(`https://${alias}`))}`);
@ -177,7 +185,6 @@ export default class Alias extends Now {
if('cert_missing'===code){
console.log(`> Provisioning certificate for ${chalk.underline(chalk.cyan(alias))}`);
awaitthis.verifyOwnership();
awaitthis.createCert();
// try again, but now having provisioned the certificate
@ -194,7 +201,7 @@ export default class Alias extends Now {
});
}
asyncverifyOwnership(domain){
verifyOwnership(domain){
returnthis.retry(async(bail,attempt)=>{
consttargets=awaitresolve4('alias.zeit.co');
@ -211,7 +218,7 @@ export default class Alias extends Now {
for(constipofips){
if(!~targets.indexOf(ip)){
consterr=newError(`The domain ${domain} has an A record ${chalk.bold(ip)} that doesn\'t resolve to ${chalk.bold('alias.zeit.co')}. Make sure the appropriate \`ALIAS\` or \`CNAME\` records are configured.`);
consterr=newError(`The domain ${domain} has an A record ${chalk.bold(ip)} that doesn\'t resolve to ${chalk.bold(chalk.underline('alias.zeit.co'))}. Please check your DNS settings.`);
err.userError=true;
returnbail(err);
}
@ -219,7 +226,7 @@ export default class Alias extends Now {