Browse Source

Merge pull request #50 from zeit/add/now-engines

Add now-engines
master
Guillermo Rauch 9 years ago
parent
commit
1c0321dae1
  1. 16
      lib/index.js

16
lib/index.js

@ -70,6 +70,8 @@ export default class Now extends EventEmitter {
this._files = hashes;
const engines = pkg['now-engines'];
const deployment = await retry(async (bail) => {
if (this._debug) console.time('> [debug] /now/create');
const res = await this._fetch('/now/create', {
@ -89,7 +91,8 @@ export default class Now extends EventEmitter {
file: toRelative(name, this._path)
};
});
}))
})),
engines
}
});
if (this._debug) console.timeEnd('> [debug] /now/create');
@ -112,8 +115,9 @@ export default class Now extends EventEmitter {
// we report about files whose sizes are too big
if (deployment.warnings) {
let sizeExceeded = 0;
deployment.warnings.forEach(({ reason, sha, limit }) => {
if ('size_limit_exceeded' === reason) {
deployment.warnings.forEach((warning) => {
if ('size_limit_exceeded' === warning.reason) {
const { sha, limit } = warning;
const name = hashes.get(sha).names.pop();
console.error('> \u001b[31mWarning!\u001b[39m Skipping file %s (size exceeded %s)',
name,
@ -121,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)
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