From 91bb144a4ca57a4d6fd8def7d90ca4aa36f61194 Mon Sep 17 00:00:00 2001 From: Ryan Sturmer Date: Tue, 8 Nov 2016 21:43:19 +0000 Subject: [PATCH] Deferred bug --- updater.js | 3 +-- util.js | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/updater.js b/updater.js index 5932fbb..570bae6 100644 --- a/updater.js +++ b/updater.js @@ -52,7 +52,7 @@ util.inherits(Updater, events.EventEmitter); Updater.prototype.getVersion = function(callback) { require('./util').doshell_promise("git describe --dirty=! --match='v*.*.*'", {cwd : __dirname, silent: true}) .then(function(data) { - parts = data.split('-'); + parts = data.split('-'); if(parts.length === 1) { var versionString = parts[0].trim(); } else { @@ -62,7 +62,6 @@ Updater.prototype.getVersion = function(callback) { callback(null, this.version); }.bind(this)) .catch(function(e) { - log.error(e); fs.readFile('version.json', 'utf8', function(err, data) { if(err) { return callback(null, this.version); diff --git a/util.js b/util.js index 30a30d0..f41c32b 100644 --- a/util.js +++ b/util.js @@ -37,7 +37,7 @@ function doshell(command, callback){ * If the command fails (nonzero error code) the promise rejects with all the stderr data from the process. */ function doshell_promise(command, options) { - deferred = Q.defer(); + var deferred = Q.defer(); options = options || {}; if(!options.silent) {