Skip to content

Commit b74e8f4

Browse files
author
chuckd
committed
Fix lint error
1 parent e8842d2 commit b74e8f4

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

buildDojo/loader.profile.js

+17-16
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,29 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
1716
/*
1817
* Dojo build profile for building the loader
1918
*/
2019
const nodeRequire = require.rawConfig && require.rawConfig.loaderPatch.nodeRequire || require;
2120
const path = nodeRequire("path");
2221
const fs = nodeRequire("fs");
23-
const version = nodeRequire(path.resolve(dojo.baseUrl, "./package.json")).version;
22+
23+
var profilePath, dojoPath;
24+
process.argv.forEach((arg, i) => {
25+
if (arg === '--profile') {
26+
profilePath = process.argv[i+1];
27+
} else if (arg === '--dojoPath') {
28+
dojoPath = process.argv[i+1];
29+
}
30+
});
31+
if (!profilePath) {
32+
throw new Error("--profile command line option not specified");
33+
}
34+
if (!dojoPath) {
35+
throw new Error("--dojoPath command line option not specified");
36+
}
37+
38+
const version = nodeRequire(path.resolve(dojoPath, "../", "./package.json")).version;
2439
const versionParts = version.split(".");
2540
const majorVersion = parseInt(versionParts[0]), minorVersion = parseInt(versionParts[1]), patchVersion = parseInt(versionParts[2]);
2641
if (majorVersion !== 1) {
@@ -33,20 +48,6 @@ const hasInjectApiFix = /* True if the version of Dojo has https://github.com/do
3348
minorVersion === 10 && patchVersion >= 9;
3449

3550
var profile = (() => {
36-
var profilePath, dojoPath;
37-
process.argv.forEach((arg, i) => {
38-
if (arg === '--profile') {
39-
profilePath = process.argv[i+1];
40-
} else if (arg === '--dojoPath') {
41-
dojoPath = process.argv[i+1];
42-
}
43-
});
44-
if (!profilePath) {
45-
throw new Error("--profile command line option not specified");
46-
}
47-
if (!dojoPath) {
48-
throw new Error("--dojoPath command line option not specified");
49-
}
5051
const profileDir = path.resolve(profilePath);
5152
const dojoDir = path.resolve(dojoPath, "..");
5253
var util = "../dojo-util";

0 commit comments

Comments
 (0)