Browse Source

handle user abort in `now domains buy` (#554)

Fixes #547.
master
Nathan Rajlich 8 years ago
committed by Guillermo Rauch
parent
commit
34151c8193
  1. 22
      bin/now-domains.js

22
bin/now-domains.js

@ -272,12 +272,22 @@ async function run({ token, config: { currentTeam, user } }) {
break
}
case 'buy': {
await require(resolve(__dirname, 'domains', 'buy.js'))({
domains: domain,
args,
currentTeam,
user
})
try {
await require(resolve(__dirname, 'domains', 'buy.js'))({
domains: domain,
args,
currentTeam,
user
})
} catch (err) {
if (err.message === 'USER_ABORT') {
// Move the prompt to a newline before exiting
console.log()
process.exit(1)
} else {
throw err
}
}
break
}
default:

Loading…
Cancel
Save