mirror of https://github.com/docker/docs.git
Fixing path escaping issues.
This commit is contained in:
parent
9c5c36c80c
commit
c280a7aece
15
index.js
15
index.js
|
@ -7,6 +7,9 @@ var path = require('path');
|
||||||
var app = require('app');
|
var app = require('app');
|
||||||
var BrowserWindow = require('browser-window');
|
var BrowserWindow = require('browser-window');
|
||||||
|
|
||||||
|
var dirname = __dirname.replace(' ', '\\ ');
|
||||||
|
console.log(dirname);
|
||||||
|
|
||||||
var freeport = function (callback) {
|
var freeport = function (callback) {
|
||||||
var server = net.createServer();
|
var server = net.createServer();
|
||||||
var port = 0;
|
var port = 0;
|
||||||
|
@ -26,7 +29,7 @@ var start = function (callback) {
|
||||||
} else {
|
} else {
|
||||||
process.stdout.write('Starting production server\n');
|
process.stdout.write('Starting production server\n');
|
||||||
if (os.platform() === 'darwin') {
|
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');
|
var dataPath = path.join(kitePath, 'data');
|
||||||
console.log(dataPath);
|
console.log(dataPath);
|
||||||
var bundlePath = path.join(kitePath, 'bundle');
|
var bundlePath = path.join(kitePath, 'bundle');
|
||||||
|
@ -47,7 +50,7 @@ var start = function (callback) {
|
||||||
console.log('MongoDB: ' + mongoPort);
|
console.log('MongoDB: ' + mongoPort);
|
||||||
console.log('webPort: ' + webPort);
|
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) {
|
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: {
|
env: {
|
||||||
PURPOSE: 'KITEMATIC'
|
PURPOSE: 'KITEMATIC'
|
||||||
}
|
}
|
||||||
|
@ -71,11 +74,11 @@ var start = function (callback) {
|
||||||
user_env.BIND_IP = '127.0.0.1';
|
user_env.BIND_IP = '127.0.0.1';
|
||||||
user_env.DB_PATH = dataPath;
|
user_env.DB_PATH = dataPath;
|
||||||
user_env.MONGO_URL = 'mongodb://localhost:' + mongoPort + '/meteor';
|
user_env.MONGO_URL = 'mongodb://localhost:' + mongoPort + '/meteor';
|
||||||
user_env.METEOR_SETTINGS = fs.readFileSync(path.join(__dirname, 'resources', 'settings.json'), 'utf8');
|
user_env.METEOR_SETTINGS = fs.readFileSync(path.join(dirname, 'resources', 'settings.json'), 'utf8');
|
||||||
user_env.DIR = __dirname;
|
user_env.DIR = dirname;
|
||||||
user_env.NODE_ENV = 'production';
|
user_env.NODE_ENV = 'production';
|
||||||
user_env.NODE_PATH = path.join(__dirname, 'node_modules');
|
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')], {
|
var nodeChild = child_process.spawn(path.join(dirname, 'resources', 'node'), [path.join(dirname, 'bundle', 'main.js')], {
|
||||||
env: user_env
|
env: user_env
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ Installer.steps = [
|
||||||
Boot2Docker.exists(function (err, exists) {
|
Boot2Docker.exists(function (err, exists) {
|
||||||
if (err) { callback(err); return; }
|
if (err) { callback(err); return; }
|
||||||
if (!exists) {
|
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)) {
|
if (fs.existsSync(vmFilesPath)) {
|
||||||
Util.deleteFolder(vmFilesPath);
|
Util.deleteFolder(vmFilesPath);
|
||||||
}
|
}
|
||||||
|
@ -98,7 +98,7 @@ Installer.steps = [
|
||||||
},
|
},
|
||||||
pastMessage: 'Setup the Kitematic VM (if required)',
|
pastMessage: 'Setup the Kitematic VM (if required)',
|
||||||
message: 'Setting up the Kitematic VM',
|
message: 'Setting up the Kitematic VM',
|
||||||
futureMessage: 'Set up the Kitematic VM(if required)'
|
futureMessage: 'Set up the Kitematic VM (if required)'
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,7 +17,7 @@ Util.getBinDir = function () {
|
||||||
};
|
};
|
||||||
|
|
||||||
Util.getResourceDir = 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');
|
Util.KITE_PATH = path.join(Util.getHomePath(), 'Kitematic');
|
||||||
|
|
Loading…
Reference in New Issue