Browse Source

Add `--hard` option to `now-rm`

master
Tony Kovanen 9 years ago
parent
commit
63ed5b31cc
  1. 3
      bin/now-remove
  2. 4
      lib/index.js

3
bin/now-remove

@ -38,6 +38,7 @@ if (!deploymentId) {
// options
const debug = argv.debug || argv.d;
const apiUrl = argv.url || 'https://api.now.sh';
const hard = argv.hard || false;
const config = cfg.read();
@ -76,7 +77,7 @@ async function remove (token) {
}
const start = new Date();
await now.remove(deploymentId);
await now.remove(deploymentId, { hard });
const elapsed = ms(new Date() - start);
console.log(`${chalk.cyan('> Deployment ')} ${chalk.bold(deploymentId)} ${chalk.cyan('removed')} [${elapsed}]`);
} catch (err) {

4
lib/index.js

@ -185,8 +185,8 @@ export default class Now extends EventEmitter {
return deployments;
}
async remove (deploymentId) {
const data = { deploymentId };
async remove (deploymentId, { hard }) {
const data = { deploymentId, hard };
await retry(async (bail) => {
if (this._debug) console.time('> [debug] /remove');

Loading…
Cancel
Save