From a2d1b478e3cbfda1ecd766f106b53e69bfcc103f Mon Sep 17 00:00:00 2001 From: Jeffrey Morgan Date: Thu, 30 Apr 2015 13:49:25 -0400 Subject: [PATCH] Restoring old supportDir method --- src/stores/SetupStore.js | 3 --- src/utils/Util.js | 13 +++++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/stores/SetupStore.js b/src/stores/SetupStore.js index 4750ed1c1b..331eeabcb4 100644 --- a/src/stores/SetupStore.js +++ b/src/stores/SetupStore.js @@ -38,7 +38,6 @@ var _steps = [{ seconds: 5, run: Promise.coroutine(function* (progressCallback) { var cmd = setupUtil.copyBinariesCmd() + ' && ' + setupUtil.fixBinariesCmd(); - if (!virtualBox.installed()) { yield virtualBox.killall(); cmd += ' && ' + setupUtil.installVirtualBoxCmd(); @@ -241,8 +240,6 @@ var SetupStore = assign(Object.create(EventEmitter.prototype), { metrics.track('Setup Failed', { step: _currentStep, }); - console.log(err); - console.log(err.message); bugsnag.notify('SetupError', err.message, { error: err, output: err.message diff --git a/src/utils/Util.js b/src/utils/Util.js index 0545f8b2bc..5205c23252 100644 --- a/src/utils/Util.js +++ b/src/utils/Util.js @@ -1,6 +1,6 @@ var exec = require('exec'); var Promise = require('bluebird'); -var fs = require('fs-promise'); +var fs = require('fs'); var path = require('path'); module.exports = { @@ -39,9 +39,14 @@ module.exports = { return process.env[this.isWindows() ? 'USERPROFILE' : 'HOME']; }, supportDir: function () { - var acc = path.join(this.home(), 'Library', 'Application\ Support', 'Kitematic'); - fs.mkdirsSync(acc); - return acc; + var dirs = ['Library', 'Application\ Support', 'Kitematic']; + var acc = process.env.HOME; + dirs.forEach(function (d) { + acc = path.join(acc, d); + if (!fs.existsSync(acc)) { + fs.mkdirSync(acc); + } + }); }, CommandOrCtrl: function () { return this.isWindows() ? 'Ctrl' : 'Command';