mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Add node path and extra paths to env for build and run calls
This commit is contained in:
10
tools/cordova/ios-runner.js
vendored
10
tools/cordova/ios-runner.js
vendored
@@ -27,11 +27,11 @@ export default class iOSRunner extends CordovaRunner {
|
||||
if (this.isDevice) {
|
||||
openInXcode(files.pathJoin(this.cordovaProject.projectRoot, 'platforms', 'ios'));
|
||||
} else {
|
||||
let path = process.env.PATH || '.';
|
||||
path += ':' + files.pathJoin(files.getCurrentToolsDir(), 'tools/node_modules/ios-sim/bin');
|
||||
let env = options.env || {};
|
||||
env.PATH = path;
|
||||
return this.cordovaProject.run(this.platform, this.isDevice, _.extend(options, { env: env }));
|
||||
const iosSimBinPath = files.convertToOSPath(
|
||||
files.pathJoin(files.getCurrentToolsDir(),
|
||||
'tools/node_modules/ios-sim/bin'));
|
||||
return this.cordovaProject.run(this.platform, this.isDevice,
|
||||
_.extend(options, { extraPaths: [iosSimBinPath] }));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
14
tools/cordova/project.js
vendored
14
tools/cordova/project.js
vendored
@@ -61,6 +61,11 @@ export default class CordovaProject {
|
||||
return { silent: !Console.verbose, verbose: Console.verbose };
|
||||
}
|
||||
|
||||
get defaultPaths() {
|
||||
const nodeBinDir = files.convertToOSPath(files.getCurrentNodeBinDir());
|
||||
return [nodeBinDir];
|
||||
}
|
||||
|
||||
// Platforms
|
||||
|
||||
getInstalledPlatforms() {
|
||||
@@ -229,7 +234,9 @@ export default class CordovaProject {
|
||||
async build(options) {
|
||||
this.chdirToProjectRoot();
|
||||
|
||||
options =_.extend(this.defaultOptions, options);
|
||||
const extraPaths = (this.defaultPaths || []).unshift(options.extraPaths);
|
||||
const env = files.currentEnvWithPathsAdded(extraPaths);
|
||||
options = _.extend(this.defaultOptions, options, { env: env });
|
||||
|
||||
return await cordova.raw.build(options);
|
||||
}
|
||||
@@ -238,7 +245,10 @@ export default class CordovaProject {
|
||||
async run(platform, isDevice, options) {
|
||||
this.chdirToProjectRoot();
|
||||
|
||||
options =_.extend(this.defaultOptions, { platforms: [platform] }, options);
|
||||
const extraPaths = (this.defaultPaths || []).unshift(options.extraPaths);
|
||||
const env = files.currentEnvWithPathsAdded(extraPaths);
|
||||
options = _.extend(this.defaultOptions, options, { env: env },
|
||||
{ platforms: [platform] });
|
||||
|
||||
if (isDevice) {
|
||||
return await cordova.raw.run(options);
|
||||
|
||||
Reference in New Issue
Block a user