Browse Source

Merge branch 'master' into add/env-flags

master
Guillermo Rauch 9 years ago
parent
commit
ff4a54a4b2
  1. 5
      bin/now-deploy
  2. 9
      lib/build-logger.js

5
bin/now-deploy

@ -212,7 +212,7 @@ async function sync (token) {
} else if (hasPackage) { } else if (hasPackage) {
if (debug) console.log('[debug] `package.json` found, assuming `deploymentType` = `npm`'); if (debug) console.log('[debug] `package.json` found, assuming `deploymentType` = `npm`');
deploymentType = 'npm'; deploymentType = 'npm';
} else if (hasDockerFile) { } else if (hasDockerfile) {
if (debug) console.log('[debug] `Dockerfile` found, assuming `deploymentType` = `docker`'); if (debug) console.log('[debug] `Dockerfile` found, assuming `deploymentType` = `docker`');
deploymentType = 'docker'; deploymentType = 'docker';
} else { } else {
@ -314,9 +314,6 @@ async function sync (token) {
function printLogs (host) { function printLogs (host) {
// log build // log build
const logger = new Logger(host, { debug, quiet }); const logger = new Logger(host, { debug, quiet });
logger.on('error', () => {
process.exit(1);
});
logger.on('close', () => { logger.on('close', () => {
if (!quiet) { if (!quiet) {
console.log(`${chalk.cyan('> Deployment complete!')}`); console.log(`${chalk.cyan('> Deployment complete!')}`);

9
lib/build-logger.js

@ -8,6 +8,7 @@ export default class Logger extends EventEmitter {
constructor (host, { debug = false, quiet = false } = {}) { constructor (host, { debug = false, quiet = false } = {}) {
super(); super();
this.host = host; this.host = host;
this.debug = debug;
this.quiet = quiet; this.quiet = quiet;
// readyState // readyState
@ -84,10 +85,10 @@ export default class Logger extends EventEmitter {
this.emit('close'); this.emit('close');
} }
onSocketError () { onSocketError (err) {
this.removeAllListeners(); if (this.debug) {
console.error('> Connection error'); console.log('> [debug] Socket error', err.stack);
this.emit('error'); }
} }
} }

Loading…
Cancel
Save