Skip to content

Commit

Permalink
stop requiring meteor on production mode (app
Browse files Browse the repository at this point in the history
after packaging)
  • Loading branch information
arboleya committed Nov 9, 2015
1 parent 12b2c5c commit 35ecd9c
Showing 1 changed file with 40 additions and 39 deletions.
79 changes: 40 additions & 39 deletions lib/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,49 +71,50 @@ function Env(input, output, settings, cli) {
this.core.tmp = join(this.os.tmp, 'electrify');
this.core.root = join(this.core.tmp, 'core');

// meteor's info from system
var meteor_dir, meteor_bat, meteor_symlink;

this.meteor = {};

if (this.sys.is_windows) {
meteor_dir = join(this.os.home, 'AppData', 'Local', '.meteor');
meteor_bat = join(meteor_dir, 'meteor.bat');
meteor_symlink = fs.readFileSync(meteor_bat).toString();
meteor_symlink = meteor_symlink.match(/\\packages.*\\meteor\.bat/)[0];
}
else {
meteor_dir = join(this.os.home, '.meteor');
meteor_symlink = fs.readlinkSync(join(meteor_dir, 'meteor'));
// meteor's info from system (only in development)
if(this.is_development_mode) {

var meteor_dir, meteor_bat, meteor_symlink;

this.meteor = {};

if (this.sys.is_windows) {
meteor_dir = join(this.os.home, 'AppData', 'Local', '.meteor');
meteor_bat = join(meteor_dir, 'meteor.bat');
meteor_symlink = fs.readFileSync(meteor_bat).toString();
meteor_symlink = meteor_symlink.match(/\\packages.*\\meteor\.bat/)[0];
}
else {
meteor_dir = join(this.os.home, '.meteor');
meteor_symlink = fs.readlinkSync(join(meteor_dir, 'meteor'));
}

this.meteor.root = join(meteor_dir, meteor_symlink);
this.meteor.tools = this.meteor.root.replace(/meteor(\.bat)?$/m, '');
this.meteor.dev_bundle = join(this.meteor.tools, 'dev_bundle');
this.meteor.server_lib = join(this.meteor.dev_bundle, 'server-lib');
this.meteor.server_modules = join(this.meteor.server_lib, 'node_modules');

if(this.sys.is_windows)
this.meteor.node_mods = join(this.meteor.dev_bundle, 'bin', 'node_modules');
else
this.meteor.node_mods = join(this.meteor.dev_bundle, 'lib', 'node_modules');

this.meteor.node = join(this.meteor.dev_bundle, 'bin', 'node');
this.meteor.npm = join(this.meteor.node_mods, 'npm', 'bin', 'npm-cli.js');
this.meteor.mongo = join(this.meteor.dev_bundle, 'mongodb', 'bin', 'mongo');
this.meteor.mongod = join(this.meteor.dev_bundle, 'mongodb', 'bin', 'mongod');

if(this.sys.is_windows) {
this.meteor.node += '.exe';
this.meteor.mongo += '.exe';
this.meteor.mongod += '.exe';
}
}

this.meteor.root = join(meteor_dir, meteor_symlink);
this.meteor.tools = this.meteor.root.replace(/meteor(\.bat)?$/m, '');
this.meteor.dev_bundle = join(this.meteor.tools, 'dev_bundle');
this.meteor.server_lib = join(this.meteor.dev_bundle, 'server-lib');
this.meteor.server_modules = join(this.meteor.server_lib, 'node_modules');

if(this.sys.is_windows)
this.meteor.node_mods = join(this.meteor.dev_bundle, 'bin', 'node_modules');
else
this.meteor.node_mods = join(this.meteor.dev_bundle, 'lib', 'node_modules');

this.meteor.node = join(this.meteor.dev_bundle, 'bin', 'node');
this.meteor.npm = join(this.meteor.node_mods, 'npm', 'bin', 'npm-cli.js');
this.meteor.mongo = join(this.meteor.dev_bundle, 'mongodb', 'bin', 'mongo');
this.meteor.mongod = join(this.meteor.dev_bundle, 'mongodb', 'bin', 'mongod');

if(this.sys.is_windows) {
this.meteor.node += '.exe';
this.meteor.mongo += '.exe';
this.meteor.mongod += '.exe';
}



if(this.stdio == 'inherit') {
console.log('====================================');
console.log(JSON.stringify(this, null, 2));
console.log('====================================');
}
}
}

0 comments on commit 35ecd9c

Please sign in to comment.