Browse Source

index: add quiet mode

master
Guillermo Rauch 9 years ago
parent
commit
0af1f69ed2
  1. 18
      lib/index.js

18
lib/index.js

@ -28,7 +28,7 @@ export default class Now extends EventEmitter {
this._onRetry = this._onRetry.bind(this); this._onRetry = this._onRetry.bind(this);
} }
async create (path, { forceNew, forceSync }) { async create (path, { forceNew, forceSync, quiet = false }) {
this._path = path; this._path = path;
try { try {
@ -139,20 +139,22 @@ export default class Now extends EventEmitter {
}); });
if (sizeExceeded) { if (sizeExceeded) {
console.log(`> \u001b[31mWarning!\u001b[39m ${sizeExceeded} of the files ` + console.error(`> \u001b[31mWarning!\u001b[39m ${sizeExceeded} of the files ` +
'exceeded the limit for your plan.\n' + 'exceeded the limit for your plan.\n' +
`> See ${chalk.underline('https://zeit.co/account')} to upgrade.`); `> See ${chalk.underline('https://zeit.co/account')} to upgrade.`);
} }
} }
if (engines && engines.node) { if (!quiet) {
if (missingVersion) { if (engines && engines.node) {
console.log(`> Using Node.js ${chalk.bold(deployment.nodeVersion)} (default)`); if (missingVersion) {
console.log(`> Using Node.js ${chalk.bold(deployment.nodeVersion)} (default)`);
} else {
console.log(`> Using Node.js ${chalk.bold(deployment.nodeVersion)} (requested: ${chalk.dim(`\`${engines.node}\``)})`);
}
} else { } else {
console.log(`> Using Node.js ${chalk.bold(deployment.nodeVersion)} (requested: ${chalk.dim(`\`${engines.node}\``)})`); console.log(`> Using Node.js ${chalk.bold(deployment.nodeVersion)} (default)`);
} }
} else {
console.log(`> Using Node.js ${chalk.bold(deployment.nodeVersion)} (default)`);
} }
this._id = deployment.deploymentId; this._id = deployment.deploymentId;

Loading…
Cancel
Save