Browse Source

Add warnings for unfound node version match

master
Tony Kovanen 9 years ago
parent
commit
18ce422962
  1. 11
      lib/index.js

11
lib/index.js

@ -115,8 +115,9 @@ export default class Now extends EventEmitter {
// we report about files whose sizes are too big // we report about files whose sizes are too big
if (deployment.warnings) { if (deployment.warnings) {
let sizeExceeded = 0; let sizeExceeded = 0;
deployment.warnings.forEach(({ reason, sha, limit }) => { deployment.warnings.forEach((warning) => {
if ('size_limit_exceeded' === reason) { if ('size_limit_exceeded' === warning.reason) {
const { sha, limit } = warning;
const name = hashes.get(sha).names.pop(); const name = hashes.get(sha).names.pop();
console.error('> \u001b[31mWarning!\u001b[39m Skipping file %s (size exceeded %s)', console.error('> \u001b[31mWarning!\u001b[39m Skipping file %s (size exceeded %s)',
name, name,
@ -124,6 +125,12 @@ export default class Now extends EventEmitter {
); );
hashes.get(sha).names.unshift(name); // move name (hack, if duplicate matches we report them in order) hashes.get(sha).names.unshift(name); // move name (hack, if duplicate matches we report them in order)
sizeExceeded++; sizeExceeded++;
} else if ('node_version_not_found' === warning.reason) {
const { wanted, used } = warning;
console.error('> \u001b[31mWarning!\u001b[39m Requested node version %s is not available, using default version %s',
wanted,
used
);
} }
}); });

Loading…
Cancel
Save