Browse Source

Fix file size warning reporting

master
Tony Kovanen 9 years ago
parent
commit
7608bf6fd6
  1. 6
      lib/index.js

6
lib/index.js

@ -114,16 +114,18 @@ export default class Now extends EventEmitter {
let sizeExceeded = 0;
deployment.warnings.forEach(({ reason, sha, limit }) => {
if ('size_limit_exceeded' === reason) {
const name = hashes.get(sha).names.pop();
console.error('> \u001b[31mWarning!\u001b[39m Skipping file %s (size exceeded %s)',
hashes.get(sha),
name,
bytes(limit)
);
hashes.get(sha).names.unshift(name); // move name (hack, if duplicate matches we report them in order)
sizeExceeded++;
}
});
if (sizeExceeded) {
console.log('> \u001b[31mWarning!\u001b[39m %d of the files ' +
console.log(`> \u001b[31mWarning!\u001b[39m ${sizeExceeded} of the files ` +
'exceeded the limit for your plan.\n' +
`> See ${chalk.underline('https://zeit.co/account')} to upgrade.`);
}

Loading…
Cancel
Save