From 63ed5b31cc47a2df3b4d76c47eb989088ff0434f Mon Sep 17 00:00:00 2001 From: Tony Kovanen Date: Wed, 20 Apr 2016 16:24:16 +0300 Subject: [PATCH] Add `--hard` option to `now-rm` --- bin/now-remove | 3 ++- lib/index.js | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/now-remove b/bin/now-remove index 7c76f05..2d15f41 100755 --- a/bin/now-remove +++ b/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) { diff --git a/lib/index.js b/lib/index.js index 41a745b..e606f85 100644 --- a/lib/index.js +++ b/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');