Browse Source

Add `-F, --forceSync` flag

master
Tony Kovanen 9 years ago
parent
commit
c5b07204bf
  1. 3
      bin/now
  2. 3
      lib/index.js

3
bin/now

@ -15,6 +15,7 @@ program
.usage('[options]')
.option('-d, --debug', 'Debug mode [off]', false)
.option('-f, --force', 'Force a new deployment even if nothing has changed', false)
.option('-F, --forceSync', 'Force a new deployment even if nothing has changed and force syncing of all files', false)
.option('-L, --login', 'Configure login')
.option('-C, --no-clipboard', 'Do not attempt to copy URL to clipboard')
.parse(process.argv);
@ -72,7 +73,7 @@ async function sync (token) {
const now = new Now(token, { debug });
try {
await now.create(path, { forceNew: program.force });
await now.create(path, { forceNew: program.force, forceSync: program.forceSync });
} catch (err) {
handleError(err);
return;

3
lib/index.js

@ -21,7 +21,7 @@ export default class Now extends EventEmitter {
this._onRetry = this._onRetry.bind(this);
}
async create (path, { forceNew }) {
async create (path, { forceNew, forceSync }) {
this._path = path;
try {
@ -63,6 +63,7 @@ export default class Now extends EventEmitter {
method: 'POST',
body: {
forceNew,
forceSync,
name: pkg.name || basename(path),
description: pkg.description,
files: Array.from(this._files).map(([sha, { data, name }]) => {

Loading…
Cancel
Save