diff --git a/index.js b/index.js index a838b66b49..d34832a640 100644 --- a/index.js +++ b/index.js @@ -7,6 +7,9 @@ var path = require('path'); var app = require('app'); var BrowserWindow = require('browser-window'); +var dirname = __dirname.replace(' ', '\\ '); +console.log(dirname); + var freeport = function (callback) { var server = net.createServer(); var port = 0; @@ -26,7 +29,7 @@ var start = function (callback) { } else { process.stdout.write('Starting production server\n'); if (os.platform() === 'darwin') { - var kitePath = path.join(process.env.HOME, 'Library/Application Support/Kitematic/'); + var kitePath = path.join(process.env.HOME, 'Library/Application\\ Support/Kitematic/'); var dataPath = path.join(kitePath, 'data'); console.log(dataPath); var bundlePath = path.join(kitePath, 'bundle'); @@ -47,7 +50,7 @@ var start = function (callback) { console.log('MongoDB: ' + mongoPort); console.log('webPort: ' + webPort); child_process.exec('kill $(ps aux -e | grep PURPOSE=KITEMATIC | awk \'{print $2}\') && rm ' + path.join(dataPath, 'mongod.lock'), function (error, stdout, stderr) { - var mongoChild = child_process.spawn(path.join(__dirname, 'resources', 'mongod'), ['--bind_ip', '127.0.0.1', '--dbpath', dataPath, '--port', mongoPort, '--unixSocketPrefix', dataPath], { + var mongoChild = child_process.spawn(path.join(dirname, 'resources', 'mongod'), ['--bind_ip', '127.0.0.1', '--dbpath', dataPath, '--port', mongoPort, '--unixSocketPrefix', dataPath], { env: { PURPOSE: 'KITEMATIC' } @@ -71,11 +74,11 @@ var start = function (callback) { user_env.BIND_IP = '127.0.0.1'; user_env.DB_PATH = dataPath; user_env.MONGO_URL = 'mongodb://localhost:' + mongoPort + '/meteor'; - user_env.METEOR_SETTINGS = fs.readFileSync(path.join(__dirname, 'resources', 'settings.json'), 'utf8'); - user_env.DIR = __dirname; + user_env.METEOR_SETTINGS = fs.readFileSync(path.join(dirname, 'resources', 'settings.json'), 'utf8'); + user_env.DIR = dirname; user_env.NODE_ENV = 'production'; - user_env.NODE_PATH = path.join(__dirname, 'node_modules'); - var nodeChild = child_process.spawn(path.join(__dirname, 'resources', 'node'), [path.join(__dirname, 'bundle', 'main.js')], { + user_env.NODE_PATH = path.join(dirname, 'node_modules'); + var nodeChild = child_process.spawn(path.join(dirname, 'resources', 'node'), [path.join(dirname, 'bundle', 'main.js')], { env: user_env }); diff --git a/meteor/client/lib/installer.js b/meteor/client/lib/installer.js index e4b6ddaaac..5f33b2d686 100644 --- a/meteor/client/lib/installer.js +++ b/meteor/client/lib/installer.js @@ -76,7 +76,7 @@ Installer.steps = [ Boot2Docker.exists(function (err, exists) { if (err) { callback(err); return; } if (!exists) { - var vmFilesPath = path.join(Util.getHomePath(), 'VirtualBox\ VMs', 'kitematic-vm'); + var vmFilesPath = path.join(Util.getHomePath(), 'VirtualBox\\ VMs', 'kitematic-vm'); if (fs.existsSync(vmFilesPath)) { Util.deleteFolder(vmFilesPath); } @@ -98,7 +98,7 @@ Installer.steps = [ }, pastMessage: 'Setup the Kitematic VM (if required)', message: 'Setting up the Kitematic VM', - futureMessage: 'Set up the Kitematic VM(if required)' + futureMessage: 'Set up the Kitematic VM (if required)' }, { diff --git a/meteor/client/lib/util.js b/meteor/client/lib/util.js index 35caad21a1..1f1df20991 100755 --- a/meteor/client/lib/util.js +++ b/meteor/client/lib/util.js @@ -17,7 +17,7 @@ Util.getBinDir = function () { }; Util.getResourceDir = function () { - return path.join(Util.getHomePath(), 'Library/Application\ Support/Kitematic/Resources'); + return path.join(Util.getHomePath(), 'Library/Application\\ Support/Kitematic/Resources'); }; Util.KITE_PATH = path.join(Util.getHomePath(), 'Kitematic');