Fixes #1403: PATH is wrong on Windows.

Signed-off-by: Attila Kelemen <attila.kelemen85@gmail.com>
This commit is contained in:
Attila Kelemen 2016-01-26 11:50:27 +01:00 коммит произвёл Attila Kelemen
Родитель dd569065d8
Коммит 16bdc16dd3
1 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -8,13 +8,17 @@ import os from 'os';
import path from 'path';
import child_process from 'child_process';
var isWin = process.platform === 'win32';
process.env.NODE_PATH = path.join(__dirname, 'node_modules');
process.env.RESOURCES_PATH = path.join(__dirname, '/../resources');
process.env.PATH = '/usr/local/bin:' + process.env.PATH;
if (!isWin) {
process.env.PATH = '/usr/local/bin:' + process.env.PATH;
}
var size = {}, settingsjson = {};
try {
size = JSON.parse(fs.readFileSync(path.join(process.env[(process.platform === 'win32') ? 'USERPROFILE' : 'HOME'], 'Library', 'Application\ Support', 'Kitematic', 'size')));
size = JSON.parse(fs.readFileSync(path.join(process.env[isWin ? 'USERPROFILE' : 'HOME'], 'Library', 'Application\ Support', 'Kitematic', 'size')));
} catch (err) {}
try {
settingsjson = JSON.parse(fs.readFileSync(path.join(__dirname, 'settings.json'), 'utf8'));