Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions bin/deepforge
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env node

const HOME_DIR = require('os').homedir();
var Command = require('commander').Command,
tcpPortUsed = require('tcp-port-used'),
program = new Command(),
Expand All @@ -16,15 +17,15 @@ var Command = require('commander').Command,
merge = require('lodash.merge'),
config,

configDir = path.join(process.env.HOME, '.deepforge'),
configDir = path.join(HOME_DIR, '.deepforge'),
configPath = path.join(configDir, 'config.json'),
dataPath = path.join(configDir, 'data'),

localConfig,
rm_rf = require('rimraf'),
p = dir => {
if (typeof dir === 'string') {
return dir.replace(/^~/, process.env.HOME); // resolve '~' to '$HOME'
return dir.replace(/^~/, HOME_DIR); // resolve '~' to '$HOME'
}
return dir;
};
Expand Down Expand Up @@ -152,7 +153,7 @@ var checkMongo = function(args, notSilent, mongoUri) {

var startMongo = function(args, port, silent) {
var opts = ['--dbpath', p(config.mongo.dir), '--port', port],
job = rawSpawn('mongod', opts, {cwd: process.env.HOME});
job = rawSpawn('mongod', opts, {cwd: HOME_DIR});

if (!silent) {
job.stdout.on('data',
Expand Down Expand Up @@ -345,7 +346,7 @@ program
if (value === null) {
console.log(`Invalid config value: "${key}"`);
return;
}
}

if (typeof value === 'object') {
value = JSON.stringify(value, null, 2);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"deepforge": "./bin/deepforge"
},
"scripts": {
"start": "./bin/deepforge start",
"start": "node ./bin/deepforge start",
"postinstall": "node utils/reinstall-extensions.js",
"start-dev": "NODE_ENV=dev node app.js",
"local": "node ./bin/start-local.js",
Expand Down
3 changes: 2 additions & 1 deletion utils/extender.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ const Q = require('q');
const rm_rf = require('rimraf');
const exists = require('exists-file');
const makeTpl = require('lodash.template');
const CONFIG_DIR = path.join(process.env.HOME, '.deepforge');
const HOME_DIR = require('os').homedir();
const CONFIG_DIR = path.join(HOME_DIR, '.deepforge');
const EXT_CONFIG_NAME = 'deepforge-extension.json';
const EXTENSION_REGISTRY_NAME = 'extensions.json';
const extConfigPath = path.join(CONFIG_DIR, EXTENSION_REGISTRY_NAME);
Expand Down