Skip to content

Commit abbbf0e

Browse files
authored
Updated NodeJS/browser exec env detection. Fixes #1212 (#1213)
1 parent 45ac912 commit abbbf0e

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/plugins/GenerateJob/GenerateJob.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,17 @@ define([
4545
this.pluginMetadata = pluginMetadata;
4646

4747
this.settings = _.extend({}, DEFAULT_SETTINGS);
48-
if (typeof WebGMEGlobal === 'undefined') { // Running in NodeJS
49-
const path = require('path');
50-
const dirname = path.dirname(module.uri);
51-
const deploymentSettings = JSON.parse(requirejs('text!' + dirname + '/../../../config/components.json'));
52-
_.extend(this.settings, deploymentSettings);
53-
} else { // Running in the browser
48+
if (require.isBrowser) {
5449
const ComponentSettings = requirejs('js/Utils/ComponentSettings');
5550
ComponentSettings.resolveWithWebGMEGlobal(
5651
this.settings,
5752
this.getComponentId()
5853
);
54+
} else { // Running in NodeJS
55+
const path = require('path');
56+
const dirname = path.dirname(module.uri);
57+
const deploymentSettings = JSON.parse(requirejs('text!' + dirname + '/../../../config/components.json'));
58+
_.extend(this.settings, deploymentSettings);
5959
}
6060
};
6161

0 commit comments

Comments
 (0)