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) {
if (debug) console.log('[debug] `package.json` found, assuming `deploymentType` = `npm`');
deploymentType = 'npm';
} else if (hasDockerFile) {
} else if (hasDockerfile) {
if (debug) console.log('[debug] `Dockerfile` found, assuming `deploymentType` = `docker`');
deploymentType = 'docker';
} else {
@ -314,9 +314,6 @@ async function sync (token) {
function printLogs (host) {
// log build
const logger = new Logger(host, { debug, quiet });
logger.on('error', () => {
process.exit(1);
});
logger.on('close', () => {
if (!quiet) {
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 } = {}) {
super();
this.host = host;
this.debug = debug;
this.quiet = quiet;
// readyState
@ -84,10 +85,10 @@ export default class Logger extends EventEmitter {
this.emit('close');
}
onSocketError () {
this.removeAllListeners();
console.error('> Connection error');
this.emit('error');
onSocketError (err) {
if (this.debug) {
console.log('> [debug] Socket error', err.stack);
}
}
}

Loading…
Cancel
Save