Browse Source

index: throw error if `start` is not defined.

master
Guillermo Rauch 9 years ago
parent
commit
6bfe556688
  1. 5
      lib/index.js

5
lib/index.js

@ -37,6 +37,11 @@ export default class Now extends EventEmitter {
throw new Error(`Failed to read JSON in "${path}/package.json"`); throw new Error(`Failed to read JSON in "${path}/package.json"`);
} }
if (!pkg.scripts || !pkg.scripts.start) {
throw new Error('Missing `start` script in `package.json`. ' +
'See: https://docs.npmjs.com/cli/start.');
}
if (this._debug) console.time('> [debug] Getting files'); if (this._debug) console.time('> [debug] Getting files');
const files = await getFiles(path, pkg, { limit: ONEMB, debug: this._debug }); const files = await getFiles(path, pkg, { limit: ONEMB, debug: this._debug });
if (this._debug) console.timeEnd('> [debug] Getting files'); if (this._debug) console.timeEnd('> [debug] Getting files');

Loading…
Cancel
Save