isaacscript 1.2.28 → 1.2.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/package.json +2 -2
- package/dist/src/checkForWindowsTerminalBugs.js +7 -7
- package/dist/src/checkForWindowsTerminalBugs.js.map +1 -1
- package/dist/src/commands/copy/copy.js +1 -1
- package/dist/src/commands/copy/copy.js.map +1 -1
- package/dist/src/commands/init/checkIfProjectPathExists.js +14 -8
- package/dist/src/commands/init/checkIfProjectPathExists.js.map +1 -1
- package/dist/src/commands/init/checkModSubdirectory.js +2 -2
- package/dist/src/commands/init/checkModSubdirectory.js.map +1 -1
- package/dist/src/commands/init/checkModTargetDirectory.js +13 -7
- package/dist/src/commands/init/checkModTargetDirectory.js.map +1 -1
- package/dist/src/commands/init/createMod.js +27 -24
- package/dist/src/commands/init/createMod.js.map +1 -1
- package/dist/src/commands/init/getModsDir.js +5 -4
- package/dist/src/commands/init/getModsDir.js.map +1 -1
- package/dist/src/commands/init/getProjectPath.js +16 -12
- package/dist/src/commands/init/getProjectPath.js.map +1 -1
- package/dist/src/commands/init/git.js +22 -13
- package/dist/src/commands/init/git.js.map +1 -1
- package/dist/src/commands/init/init.js +10 -7
- package/dist/src/commands/init/init.js.map +1 -1
- package/dist/src/commands/init/installVSCodeExtensions.js +4 -4
- package/dist/src/commands/init/installVSCodeExtensions.js.map +1 -1
- package/dist/src/commands/init/promptSaveSlot.js +4 -1
- package/dist/src/commands/init/promptSaveSlot.js.map +1 -1
- package/dist/src/commands/monitor/copyWatcherMod.js +3 -3
- package/dist/src/commands/monitor/copyWatcherMod.js.map +1 -1
- package/dist/src/commands/monitor/getTSConfigInclude.js +2 -2
- package/dist/src/commands/monitor/getTSConfigInclude.js.map +1 -1
- package/dist/src/commands/monitor/monitor.js +2 -2
- package/dist/src/commands/monitor/monitor.js.map +1 -1
- package/dist/src/commands/monitor/saveDatWriter/saveDatWriter.js +13 -12
- package/dist/src/commands/monitor/saveDatWriter/saveDatWriter.js.map +1 -1
- package/dist/src/commands/monitor/touchWatcherSaveDatFiles.js +2 -2
- package/dist/src/commands/monitor/touchWatcherSaveDatFiles.js.map +1 -1
- package/dist/src/commands/publish/publish.js +16 -16
- package/dist/src/commands/publish/publish.js.map +1 -1
- package/dist/src/configFile.js +7 -6
- package/dist/src/configFile.js.map +1 -1
- package/dist/src/exec.js +2 -2
- package/dist/src/exec.js.map +1 -1
- package/dist/src/file.js +37 -7
- package/dist/src/file.js.map +1 -1
- package/dist/src/main.js +5 -4
- package/dist/src/main.js.map +1 -1
- package/dist/src/parseArgs.js +5 -0
- package/dist/src/parseArgs.js.map +1 -1
- package/dist/src/utils.js +7 -1
- package/dist/src/utils.js.map +1 -1
- package/dist/src/validateInIsaacScriptProject.js +3 -2
- package/dist/src/validateInIsaacScriptProject.js.map +1 -1
- package/package.json +2 -2
- package/src/checkForWindowsTerminalBugs.ts +9 -7
- package/src/commands/copy/copy.ts +1 -1
- package/src/commands/init/checkIfProjectPathExists.ts +19 -12
- package/src/commands/init/checkModSubdirectory.ts +2 -2
- package/src/commands/init/checkModTargetDirectory.ts +18 -12
- package/src/commands/init/createMod.ts +47 -37
- package/src/commands/init/getModsDir.ts +7 -3
- package/src/commands/init/getProjectPath.ts +19 -12
- package/src/commands/init/git.ts +34 -18
- package/src/commands/init/init.ts +14 -6
- package/src/commands/init/installVSCodeExtensions.ts +4 -4
- package/src/commands/init/promptSaveSlot.ts +5 -0
- package/src/commands/monitor/copyWatcherMod.ts +3 -3
- package/src/commands/monitor/getTSConfigInclude.ts +2 -2
- package/src/commands/monitor/monitor.ts +2 -2
- package/src/commands/monitor/saveDatWriter/saveDatWriter.ts +14 -12
- package/src/commands/monitor/touchWatcherSaveDatFiles.ts +2 -2
- package/src/commands/publish/publish.ts +16 -16
- package/src/configFile.ts +7 -6
- package/src/exec.ts +2 -4
- package/src/file.ts +51 -7
- package/src/main.ts +5 -4
- package/src/parseArgs.ts +6 -0
- package/src/utils.ts +8 -0
- package/src/validateInIsaacScriptProject.ts +5 -2
package/dist/src/file.js
CHANGED
|
@@ -43,7 +43,10 @@ function deleteFileOrDirectory(filePath, verbose) {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
exports.deleteFileOrDirectory = deleteFileOrDirectory;
|
|
46
|
-
function exists(filePath) {
|
|
46
|
+
function exists(filePath, verbose) {
|
|
47
|
+
if (verbose) {
|
|
48
|
+
console.log(`Checking to see if the following path exists: ${filePath}`);
|
|
49
|
+
}
|
|
47
50
|
let pathExists;
|
|
48
51
|
try {
|
|
49
52
|
pathExists = fs_extra_1.default.existsSync(filePath);
|
|
@@ -51,10 +54,16 @@ function exists(filePath) {
|
|
|
51
54
|
catch (err) {
|
|
52
55
|
(0, utils_1.error)(`Failed to check to see if "${chalk_1.default.green(filePath)}" exists:`, err);
|
|
53
56
|
}
|
|
57
|
+
if (verbose) {
|
|
58
|
+
console.log(`Path exists: ${pathExists}`);
|
|
59
|
+
}
|
|
54
60
|
return pathExists;
|
|
55
61
|
}
|
|
56
62
|
exports.exists = exists;
|
|
57
|
-
function getDirList(dirPath) {
|
|
63
|
+
function getDirList(dirPath, verbose) {
|
|
64
|
+
if (verbose) {
|
|
65
|
+
console.log(`Getting a directory list from: ${dirPath}`);
|
|
66
|
+
}
|
|
58
67
|
let fileList;
|
|
59
68
|
try {
|
|
60
69
|
fileList = fs_extra_1.default.readdirSync(dirPath);
|
|
@@ -62,10 +71,16 @@ function getDirList(dirPath) {
|
|
|
62
71
|
catch (err) {
|
|
63
72
|
(0, utils_1.error)(`Failed to get the files in the "${chalk_1.default.green(dirPath)}" directory:`, err);
|
|
64
73
|
}
|
|
74
|
+
if (verbose) {
|
|
75
|
+
console.log(`Got a directory list from: ${dirPath}`);
|
|
76
|
+
}
|
|
65
77
|
return fileList;
|
|
66
78
|
}
|
|
67
79
|
exports.getDirList = getDirList;
|
|
68
|
-
function getFileStats(filePath) {
|
|
80
|
+
function getFileStats(filePath, verbose) {
|
|
81
|
+
if (verbose) {
|
|
82
|
+
console.log(`Getting file stats from: ${filePath}`);
|
|
83
|
+
}
|
|
69
84
|
let fileStats;
|
|
70
85
|
try {
|
|
71
86
|
fileStats = fs_extra_1.default.statSync(filePath);
|
|
@@ -73,10 +88,13 @@ function getFileStats(filePath) {
|
|
|
73
88
|
catch (err) {
|
|
74
89
|
(0, utils_1.error)(`Failed to get the file stats for "${chalk_1.default.green(filePath)}":`, err);
|
|
75
90
|
}
|
|
91
|
+
if (verbose) {
|
|
92
|
+
console.log(`Got file stats from: ${filePath}`);
|
|
93
|
+
}
|
|
76
94
|
return fileStats;
|
|
77
95
|
}
|
|
78
|
-
function isDir(filePath) {
|
|
79
|
-
const fileStats = getFileStats(filePath);
|
|
96
|
+
function isDir(filePath, verbose) {
|
|
97
|
+
const fileStats = getFileStats(filePath, verbose);
|
|
80
98
|
return fileStats.isDirectory();
|
|
81
99
|
}
|
|
82
100
|
exports.isDir = isDir;
|
|
@@ -102,7 +120,10 @@ function makeDir(dirPath, verbose) {
|
|
|
102
120
|
}
|
|
103
121
|
}
|
|
104
122
|
exports.makeDir = makeDir;
|
|
105
|
-
function read(filePath) {
|
|
123
|
+
function read(filePath, verbose) {
|
|
124
|
+
if (verbose) {
|
|
125
|
+
console.log(`Reading a file: ${filePath}`);
|
|
126
|
+
}
|
|
106
127
|
let fileContents;
|
|
107
128
|
try {
|
|
108
129
|
fileContents = fs_extra_1.default.readFileSync(filePath, "utf8");
|
|
@@ -110,6 +131,9 @@ function read(filePath) {
|
|
|
110
131
|
catch (err) {
|
|
111
132
|
(0, utils_1.error)(`Failed to read the "${chalk_1.default.green(filePath)}" file:`, err);
|
|
112
133
|
}
|
|
134
|
+
if (verbose) {
|
|
135
|
+
console.log(`Read a file: ${filePath}`);
|
|
136
|
+
}
|
|
113
137
|
return fileContents;
|
|
114
138
|
}
|
|
115
139
|
exports.read = read;
|
|
@@ -144,8 +168,14 @@ function write(filePath, data, verbose) {
|
|
|
144
168
|
}
|
|
145
169
|
}
|
|
146
170
|
exports.write = write;
|
|
147
|
-
function writeTry(filePath, data) {
|
|
171
|
+
function writeTry(filePath, data, verbose) {
|
|
172
|
+
if (verbose) {
|
|
173
|
+
console.log(`Writing data to: ${filePath}`);
|
|
174
|
+
}
|
|
148
175
|
fs_extra_1.default.writeFileSync(filePath, data);
|
|
176
|
+
if (verbose) {
|
|
177
|
+
console.log(`Wrote data to: ${filePath}`);
|
|
178
|
+
}
|
|
149
179
|
}
|
|
150
180
|
exports.writeTry = writeTry;
|
|
151
181
|
//# sourceMappingURL=file.js.map
|
package/dist/src/file.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.js","sourceRoot":"","sources":["../../src/file.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,wDAA0B;AAC1B,gDAAwB;AACxB,mCAAgC;AAEhC,SAAgB,IAAI,CAAC,OAAe,EAAE,OAAe,EAAE,OAAgB;IACrE,IAAI,OAAO,EAAE;QACX,OAAO,CAAC,GAAG,CAAC,YAAY,OAAO,QAAQ,OAAO,EAAE,CAAC,CAAC;KACnD;IAED,IAAI;QACF,0EAA0E;QAC1E,kBAAE,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE;YAC5B,SAAS,EAAE,IAAI;SAChB,CAAC,CAAC;KACJ;IAAC,OAAO,GAAG,EAAE;QACZ,IAAA,aAAK,EACH,6BAA6B,eAAK,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,eAAK,CAAC,KAAK,CACnE,OAAO,CACR,IAAI,EACL,GAAG,CACJ,CAAC;KACH;IAED,IAAI,OAAO,EAAE;QACX,OAAO,CAAC,GAAG,CAAC,WAAW,OAAO,QAAQ,OAAO,EAAE,CAAC,CAAC;KAClD;AACH,CAAC;AAtBD,oBAsBC;AAED,SAAgB,qBAAqB,CACnC,QAAgB,EAChB,OAAgB;IAEhB,IAAI,OAAO,EAAE;QACX,OAAO,CAAC,GAAG,CAAC,aAAa,QAAQ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IAAA,aAAK,EAAC,wBAAwB,eAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;KACpE;IAED,IAAI,OAAO,EAAE;QACX,OAAO,CAAC,GAAG,CAAC,YAAY,QAAQ,EAAE,CAAC,CAAC;KACrC;AACH,CAAC;AAfD,sBAeC;AAED,SAAgB,KAAK,CAAC,QAAgB,EAAE,IAAY,EAAE,OAAgB;IACpE,IAAI,OAAO,EAAE;QACX,OAAO,CAAC,GAAG,CAAC,oBAAoB,QAAQ,EAAE,CAAC,CAAC;KAC7C;IAED,IAAI;QACF,kBAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;KAClC;IAAC,OAAO,GAAG,EAAE;QACZ,IAAA,aAAK,EAAC,2BAA2B,eAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;KACvE;IAED,IAAI,OAAO,EAAE;QACX,OAAO,CAAC,GAAG,CAAC,kBAAkB,QAAQ,EAAE,CAAC,CAAC;KAC3C;AACH,CAAC;AAdD,sBAcC;AAED,SAAgB,QAAQ,CACtB,QAAgB,EAChB,IAAY,EACZ,OAAgB;IAEhB,IAAI,OAAO,EAAE;QACX,OAAO,CAAC,GAAG,CAAC,oBAAoB,QAAQ,EAAE,CAAC,CAAC;KAC7C;IAED,kBAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IAEjC,IAAI,OAAO,EAAE;QACX,OAAO,CAAC,GAAG,CAAC,kBAAkB,QAAQ,EAAE,CAAC,CAAC;KAC3C;AACH,CAAC;AAdD,4BAcC"}
|
package/dist/src/main.js
CHANGED
|
@@ -60,12 +60,13 @@ async function main() {
|
|
|
60
60
|
loadEnvironmentVariables();
|
|
61
61
|
// Get command line arguments
|
|
62
62
|
const argv = (0, parseArgs_1.parseArgs)();
|
|
63
|
+
const verbose = argv.verbose === true;
|
|
63
64
|
printBanner();
|
|
64
65
|
// Check for a new version
|
|
65
66
|
(0, update_notifier_1.default)({ pkg: package_json_1.default }).notify();
|
|
66
67
|
// Pre-flight checks
|
|
67
|
-
await (0, checkForWindowsTerminalBugs_1.checkForWindowsTerminalBugs)();
|
|
68
|
-
await handleCommands(argv);
|
|
68
|
+
await (0, checkForWindowsTerminalBugs_1.checkForWindowsTerminalBugs)(verbose);
|
|
69
|
+
await handleCommands(argv, verbose);
|
|
69
70
|
}
|
|
70
71
|
function loadEnvironmentVariables() {
|
|
71
72
|
const envFile = path_1.default.join(constants_1.CWD, ".env");
|
|
@@ -79,7 +80,7 @@ function printBanner() {
|
|
|
79
80
|
console.log(version.padStart(leftPaddingAmount));
|
|
80
81
|
console.log();
|
|
81
82
|
}
|
|
82
|
-
async function handleCommands(argv) {
|
|
83
|
+
async function handleCommands(argv, verbose) {
|
|
83
84
|
const positionalArgs = argv._;
|
|
84
85
|
let command;
|
|
85
86
|
if (positionalArgs.length > 0) {
|
|
@@ -90,7 +91,7 @@ async function handleCommands(argv) {
|
|
|
90
91
|
}
|
|
91
92
|
let config = new Config_1.Config();
|
|
92
93
|
if (command !== "init") {
|
|
93
|
-
(0, validateInIsaacScriptProject_1.validateInIsaacScriptProject)();
|
|
94
|
+
(0, validateInIsaacScriptProject_1.validateInIsaacScriptProject)(verbose);
|
|
94
95
|
config = await configFile.get(argv);
|
|
95
96
|
}
|
|
96
97
|
switch (command) {
|
package/dist/src/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,kDAA0B;AAC1B,+CAAiC;AACjC,oDAA4B;AAC5B,gDAAwB;AACxB,4EAAkD;AAClD,sEAA6C;AAC7C,mEAAkC;AAClC,+EAA4E;AAC5E,+CAA4C;AAC5C,+CAA4C;AAC5C,wDAAqD;AACrD,wDAAqD;AACrD,yDAA2C;AAC3C,2CAAgD;AAChD,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AAC;IACrB,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE;QAC7B,OAAO,GAAG,cAAc,CAAC,CAAC,CAAY,CAAC;KACxC;SAAM;QACL,OAAO,GAAG,yBAAe,CAAC;KAC3B;IAED,IAAI,MAAM,GAAG,IAAI,eAAM,EAAE,CAAC;IAC1B,IAAI,OAAO,KAAK,MAAM,EAAE;QACtB,IAAA,2DAA4B,EAAC,OAAO,CAAC,CAAC;QACtC,MAAM,GAAG,MAAM,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;KACrC;IAED,QAAQ,OAAO,EAAE;QACf,KAAK,SAAS,CAAC,CAAC;YACd,IAAA,iBAAO,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;YACtB,MAAM;SACP;QAED,KAAK,MAAM,CAAC,CAAC;YACX,MAAM,IAAA,WAAI,EAAC,IAAI,CAAC,CAAC;YACjB,MAAM;SACP;QAED,KAAK,MAAM,CAAC,CAAC;YACX,IAAA,WAAI,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;YACnB,MAAM;SACP;QAED,KAAK,SAAS,CAAC,CAAC;YACd,IAAA,iBAAO,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;YACtB,MAAM;SACP;QAED,OAAO,CAAC,CAAC;YACP,IAAA,sBAAc,EAAC,OAAO,CAAC,CAAC;YACxB,MAAM;SACP;KACF;IAED,IAAI,OAAO,KAAK,SAAS,EAAE;QACzB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;AACH,CAAC"}
|
package/dist/src/parseArgs.js
CHANGED
|
@@ -29,6 +29,11 @@ function parseArgs() {
|
|
|
29
29
|
description: "Enable verbose output",
|
|
30
30
|
}))
|
|
31
31
|
.command("init [name]", `Initialize a new ${constants_1.PROJECT_NAME} mod.`, (builder) => builder
|
|
32
|
+
.option("yes", {
|
|
33
|
+
alias: "y",
|
|
34
|
+
type: "boolean",
|
|
35
|
+
description: 'Answer yes to every dialog option, similar to how "npm init --yes" works.',
|
|
36
|
+
})
|
|
32
37
|
.option("use-current-dir", {
|
|
33
38
|
alias: "u",
|
|
34
39
|
type: "boolean",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseArgs.js","sourceRoot":"","sources":["../../src/parseArgs.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,2CAA2C;AAE3C,SAAgB,SAAS;IACvB,MAAM,WAAW,GAAG,IAAA,eAAK,EAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SAC7C,MAAM,EAAE;SACR,KAAK,CAAC,wCAAwC,CAAC;SAC/C,UAAU,CAAC,aAAa,CAAC;SAEzB,OAAO,CAAC,SAAS,EAAE,0CAA0C,EAAE,CAAC,OAAO,EAAE,EAAE,CAC1E,OAAO;SACJ,MAAM,CAAC,gBAAgB,EAAE;QACxB,KAAK,EAAE,GAAG;QACV,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,oDAAoD;KAClE,CAAC;SACD,MAAM,CAAC,WAAW,EAAE;QACnB,KAAK,EAAE,GAAG;QACV,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QAClB,WAAW,EAAE,oCAAoC;KAClD,CAAC;SACD,MAAM,CAAC,SAAS,EAAE;QACjB,KAAK,EAAE,GAAG;QACV,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,uBAAuB;KACrC,CAAC,CACL;SAEA,OAAO,CACN,aAAa,EACb,oBAAoB,wBAAY,OAAO,EACvC,CAAC,OAAO,EAAE,EAAE,CACV,OAAO;SACJ,MAAM,CAAC,iBAAiB,EAAE;QACzB,KAAK,EAAE,GAAG;QACV,IAAI,EAAE,SAAS;QACf,WAAW,EACT,uDAAuD;KAC1D,CAAC;SACD,MAAM,CAAC,gBAAgB,EAAE;QACxB,KAAK,EAAE,GAAG;QACV,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,oDAAoD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,sCAAsC;KACpD,CAAC;SACD,MAAM,CAAC,aAAa,EAAE;QACrB,KAAK,EAAE,GAAG;QACV,IAAI,EAAE,QAAQ;QACd,WAAW,EACT,uDAAuD;KAC1D,CAAC;SACD,MAAM,CAAC,SAAS,EAAE;QACjB,KAAK,EAAE,GAAG;QACV,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,wBAAwB;KACtC,CAAC;SACD,MAAM,CAAC,aAAa,EAAE;QACrB,KAAK,EAAE,GAAG;QACV,IAAI,EAAE,SAAS;QACf,WAAW,EACT,yEAAyE;KAC5E,CAAC;SACD,MAAM,CAAC,SAAS,EAAE;QACjB,KAAK,EAAE,GAAG;QACV,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,uBAAuB;KACrC,CAAC,CACP;SAEA,KAAK,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,uCAAuC;SAC1D,KAAK,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC,0CAA0C;IAEpE,OAAO,WAAW,CAAC,IAA+B,CAAC;AACrD,CAAC;AAtHD,8BAsHC"}
|
package/dist/src/utils.js
CHANGED
|
@@ -3,9 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.parseSemVer = exports.parseIntSafe = exports.hasWhiteSpace = exports.getTime = exports.getModTargetDirectoryName = exports.error = exports.ensureAllCases = void 0;
|
|
6
|
+
exports.parseSemVer = exports.parseIntSafe = exports.isKebabCase = exports.hasWhiteSpace = exports.getTime = exports.getModTargetDirectoryName = exports.error = exports.ensureAllCases = void 0;
|
|
7
7
|
const moment_1 = __importDefault(require("moment"));
|
|
8
8
|
const constants_1 = require("./constants");
|
|
9
|
+
/** From: https://github.com/expandjs/expandjs/blob/master/lib/kebabCaseRegex.js */
|
|
10
|
+
const KEBAB_CASE_REGEX = /^([a-z](?![\d])|[\d](?![a-z]))+(-?([a-z](?![\d])|[\d](?![a-z])))*$|^$/;
|
|
9
11
|
const ensureAllCases = (obj) => obj;
|
|
10
12
|
exports.ensureAllCases = ensureAllCases;
|
|
11
13
|
function error(...args) {
|
|
@@ -28,6 +30,10 @@ function hasWhiteSpace(s) {
|
|
|
28
30
|
return /\s/g.test(s);
|
|
29
31
|
}
|
|
30
32
|
exports.hasWhiteSpace = hasWhiteSpace;
|
|
33
|
+
function isKebabCase(s) {
|
|
34
|
+
return KEBAB_CASE_REGEX.test(s);
|
|
35
|
+
}
|
|
36
|
+
exports.isKebabCase = isKebabCase;
|
|
31
37
|
/**
|
|
32
38
|
* parseIntSafe is a more reliable version of parseInt. By default, "parseInt('1a')" will return
|
|
33
39
|
* "1", which is unexpected. This returns either an integer or NaN.
|
package/dist/src/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAC5B,2CAAqD;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAC5B,2CAAqD;AAGrD,mFAAmF;AACnF,MAAM,gBAAgB,GACpB,uEAAuE,CAAC;AAEnE,MAAM,cAAc,GAAG,CAAC,GAAU,EAAS,EAAE,CAAC,GAAG,CAAC;AAA5C,QAAA,cAAc,kBAA8B;AAEzD,SAAgB,KAAK,CAAC,GAAG,IAAe;IACtC,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;IACvB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAHD,sBAGC;AAED,SAAgB,yBAAyB,CAAC,MAAc;IACtD,OAAO,MAAM,CAAC,4BAA4B,KAAK,SAAS;QACtD,CAAC,CAAC,kCAAsB;QACxB,CAAC,CAAC,MAAM,CAAC,4BAA4B,CA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AED,MAAM,CAAC,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,kBAAkB,CAAC,GAAG,KAAK,CAAC;IAE7E,MAAM,YAAY,GAAG,YAAY,CAAC,kBAAkB,CAAC,CAAC;IACtD,IAAI,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE;QAC9B,KAAK,CAAC,kDAAkD,aAAa,EAAE,CAAC,CAAC;KAC1E;IAED,MAAM,YAAY,GAAG,QAAQ,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;IACtD,IAAI,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE;QAC9B,KAAK,CAAC,kDAAkD,aAAa,EAAE,CAAC,CAAC;KAC1E;IAED,MAAM,YAAY,GAAG,QAAQ,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;IACtD,IAAI,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE;QAC9B,KAAK,CAAC,kDAAkD,aAAa,EAAE,CAAC,CAAC;KAC1E;IAED,OAAO,CAAC,YAAY,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;AACpD,CAAC;AA1BD,kCA0BC"}
|
|
@@ -32,11 +32,12 @@ const path_1 = __importDefault(require("path"));
|
|
|
32
32
|
const constants_1 = require("./constants");
|
|
33
33
|
const file = __importStar(require("./file"));
|
|
34
34
|
// Validate that we are in a directory that looks like an IsaacScript project
|
|
35
|
-
function validateInIsaacScriptProject() {
|
|
35
|
+
function validateInIsaacScriptProject(verbose) {
|
|
36
36
|
const subdirectoriesToCheck = ["src", "mod", "node_modules"];
|
|
37
37
|
for (const subdirectoryName of subdirectoriesToCheck) {
|
|
38
38
|
const subdirectoryPath = path_1.default.join(constants_1.CWD, subdirectoryName);
|
|
39
|
-
if (!file.exists(subdirectoryPath) ||
|
|
39
|
+
if (!file.exists(subdirectoryPath, verbose) ||
|
|
40
|
+
!file.isDir(subdirectoryPath, verbose)) {
|
|
40
41
|
errorNotExists(subdirectoryPath);
|
|
41
42
|
}
|
|
42
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validateInIsaacScriptProject.js","sourceRoot":"","sources":["../../src/validateInIsaacScriptProject.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,gDAAwB;AACxB,2CAAgD;AAChD,6CAA+B;AAE/B,6EAA6E;AAC7E,SAAgB,4BAA4B;
|
|
1
|
+
{"version":3,"file":"validateInIsaacScriptProject.js","sourceRoot":"","sources":["../../src/validateInIsaacScriptProject.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,gDAAwB;AACxB,2CAAgD;AAChD,6CAA+B;AAE/B,6EAA6E;AAC7E,SAAgB,4BAA4B,CAAC,OAAgB;IAC3D,MAAM,qBAAqB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC;IAC7D,KAAK,MAAM,gBAAgB,IAAI,qBAAqB,EAAE;QACpD,MAAM,gBAAgB,GAAG,cAAI,CAAC,IAAI,CAAC,eAAG,EAAE,gBAAgB,CAAC,CAAC;QAC1D,IACE,CAAC,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,OAAO,CAAC;YACvC,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,OAAO,CAAC,EACtC;YACA,cAAc,CAAC,gBAAgB,CAAC,CAAC;SAClC;KACF;AACH,CAAC;AAXD,oEAWC;AAED,SAAS,cAAc,CAAC,OAAe;IACrC,OAAO,CAAC,KAAK,CACX,eAAK,CAAC,GAAG,CACP,yDAAyD,wBAAY,2BAA2B,OAAO,uBAAuB,CAC/H,CACF,CAAC;IACF,OAAO,CAAC,KAAK,CACX,gCAAgC,wBAAY,kBAAkB,eAAK,CAAC,KAAK,CACvE,sBAAsB,CACvB,IAAI,CACN,CAAC;IACF,OAAO,CAAC,KAAK,CACX,2DAA2D,wBAAY,WAAW,CACnF,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.31",
|
|
4
4
|
"description": "A command line tool for managing Isaac mods written in TypeScript",
|
|
5
5
|
"homepage": "https://isaacscript.github.io/",
|
|
6
6
|
"bugs": {
|
|
@@ -45,6 +45,6 @@
|
|
|
45
45
|
"@types/source-map-support": "^0.5.4",
|
|
46
46
|
"@types/update-notifier": "^5.1.0",
|
|
47
47
|
"@types/yargs": "^17.0.10",
|
|
48
|
-
"isaacscript-lint": "^1.0.
|
|
48
|
+
"isaacscript-lint": "^1.0.99"
|
|
49
49
|
}
|
|
50
50
|
}
|
|
@@ -11,7 +11,9 @@ const BASH_PROFILE_PATH = path.join(HOME_DIR, ".bash_profile");
|
|
|
11
11
|
// By default, Git Bash for Windows uses MINGW64
|
|
12
12
|
// This will not work correctly with the prompt library
|
|
13
13
|
// Try to detect this and warn the end-user
|
|
14
|
-
export async function checkForWindowsTerminalBugs(
|
|
14
|
+
export async function checkForWindowsTerminalBugs(
|
|
15
|
+
verbose: boolean,
|
|
16
|
+
): Promise<void> {
|
|
15
17
|
if (process.platform !== "win32") {
|
|
16
18
|
return;
|
|
17
19
|
}
|
|
@@ -20,10 +22,10 @@ export async function checkForWindowsTerminalBugs(): Promise<void> {
|
|
|
20
22
|
return;
|
|
21
23
|
}
|
|
22
24
|
|
|
23
|
-
await checkForWindowsBugColor();
|
|
25
|
+
await checkForWindowsBugColor(verbose);
|
|
24
26
|
}
|
|
25
27
|
|
|
26
|
-
async function checkForWindowsBugColor() {
|
|
28
|
+
async function checkForWindowsBugColor(verbose: boolean) {
|
|
27
29
|
if (process.env.FORCE_COLOR === "true") {
|
|
28
30
|
return;
|
|
29
31
|
}
|
|
@@ -46,14 +48,14 @@ async function checkForWindowsBugColor() {
|
|
|
46
48
|
return;
|
|
47
49
|
}
|
|
48
50
|
|
|
49
|
-
applyFixesToBashProfile();
|
|
51
|
+
applyFixesToBashProfile(verbose);
|
|
50
52
|
}
|
|
51
53
|
|
|
52
|
-
function applyFixesToBashProfile() {
|
|
54
|
+
function applyFixesToBashProfile(verbose: boolean) {
|
|
53
55
|
// Check to see if the Bash profile has data
|
|
54
56
|
let bashProfileContents: string;
|
|
55
|
-
if (file.exists(BASH_PROFILE_PATH)) {
|
|
56
|
-
bashProfileContents = file.read(BASH_PROFILE_PATH);
|
|
57
|
+
if (file.exists(BASH_PROFILE_PATH, verbose)) {
|
|
58
|
+
bashProfileContents = file.read(BASH_PROFILE_PATH, verbose);
|
|
57
59
|
} else {
|
|
58
60
|
bashProfileContents = "";
|
|
59
61
|
}
|
|
@@ -33,7 +33,7 @@ function copyMod(
|
|
|
33
33
|
modTargetPath: string,
|
|
34
34
|
verbose: boolean,
|
|
35
35
|
) {
|
|
36
|
-
if (file.exists(modTargetPath)) {
|
|
36
|
+
if (file.exists(modTargetPath, verbose)) {
|
|
37
37
|
file.deleteFileOrDirectory(modTargetPath, verbose);
|
|
38
38
|
}
|
|
39
39
|
file.copy(modSourcePath, modTargetPath, verbose);
|
|
@@ -6,22 +6,29 @@ import { error } from "../../utils";
|
|
|
6
6
|
|
|
7
7
|
export async function checkIfProjectPathExists(
|
|
8
8
|
projectPath: string,
|
|
9
|
+
yes: boolean,
|
|
9
10
|
verbose: boolean,
|
|
10
11
|
): Promise<void> {
|
|
11
|
-
if (projectPath
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
`A ${fileType} already exists with a name of "${chalk.green(
|
|
15
|
-
projectPath,
|
|
16
|
-
)}".`,
|
|
17
|
-
);
|
|
18
|
-
|
|
19
|
-
const shouldDelete = await getInputYesNo("Do you want me to delete it?");
|
|
12
|
+
if (projectPath === CWD || !file.exists(projectPath, verbose)) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
20
15
|
|
|
21
|
-
|
|
22
|
-
error("Ok then. Good-bye.");
|
|
23
|
-
}
|
|
16
|
+
const fileType = file.isDir(projectPath, verbose) ? "directory" : "file";
|
|
24
17
|
|
|
18
|
+
if (yes) {
|
|
25
19
|
file.deleteFileOrDirectory(projectPath, verbose);
|
|
20
|
+
console.log(`Deleted ${fileType}: ${chalk.green(projectPath)}`);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
console.log(
|
|
25
|
+
`A ${fileType} already exists with a name of: ${chalk.green(projectPath)}`,
|
|
26
|
+
);
|
|
27
|
+
const shouldDelete = await getInputYesNo("Do you want me to delete it?");
|
|
28
|
+
|
|
29
|
+
if (!shouldDelete) {
|
|
30
|
+
error("Ok then. Goodbye.");
|
|
26
31
|
}
|
|
32
|
+
|
|
33
|
+
file.deleteFileOrDirectory(projectPath, verbose);
|
|
27
34
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import chalk from "chalk";
|
|
2
2
|
import { CWD } from "../../constants";
|
|
3
3
|
import * as file from "../../file";
|
|
4
|
+
import { error } from "../../utils";
|
|
4
5
|
|
|
5
6
|
export function checkModSubdirectory(
|
|
6
7
|
projectPath: string,
|
|
@@ -12,9 +13,8 @@ export function checkModSubdirectory(
|
|
|
12
13
|
projectPath,
|
|
13
14
|
)}" is a subdirectory of "${chalk.green(modsDirectory)}".`,
|
|
14
15
|
);
|
|
15
|
-
|
|
16
|
+
error(
|
|
16
17
|
'You are supposed to have your project folder somewhere else on the system than the Isaac mods directory. (This is because we don\'t want to upload the ".git" folder or the TypeScript files to the Steam Workshop.) Exiting.',
|
|
17
18
|
);
|
|
18
|
-
process.exit(1);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
@@ -8,28 +8,34 @@ import { error } from "../../utils";
|
|
|
8
8
|
export async function checkModTargetDirectory(
|
|
9
9
|
modsDirectory: string,
|
|
10
10
|
projectName: string,
|
|
11
|
+
yes: boolean,
|
|
11
12
|
verbose: boolean,
|
|
12
13
|
): Promise<void> {
|
|
13
14
|
const modTargetPath = path.join(modsDirectory, projectName);
|
|
14
|
-
if (!file.exists(modTargetPath)) {
|
|
15
|
+
if (!file.exists(modTargetPath, verbose)) {
|
|
15
16
|
return;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
const fileType = file.isDir(modTargetPath, verbose) ? "directory" : "file";
|
|
20
|
+
|
|
21
|
+
if (yes) {
|
|
22
|
+
file.deleteFileOrDirectory(modTargetPath, verbose);
|
|
23
|
+
console.log(`Deleted ${fileType}: ${chalk.green(modTargetPath)}`);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
console.log(
|
|
28
|
+
`A ${fileType} already exists at at the mod path of: ${chalk.green(
|
|
20
29
|
modTargetPath,
|
|
21
|
-
)}
|
|
22
|
-
);
|
|
23
|
-
console.error(
|
|
24
|
-
`When you run ${PROJECT_NAME}, it will want to create a directory here so that it can sync it with your project folder.`,
|
|
30
|
+
)}`,
|
|
25
31
|
);
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"Should I delete the existing directory for you? (Make sure that it does not contain anything important first.)",
|
|
32
|
+
console.log(
|
|
33
|
+
`${PROJECT_NAME} will need to sync your project folder with this directory.`,
|
|
29
34
|
);
|
|
35
|
+
const shouldDelete = await getInputYesNo("Do you want me to delete it?");
|
|
30
36
|
|
|
31
|
-
if (!
|
|
32
|
-
error("Ok then.
|
|
37
|
+
if (!shouldDelete) {
|
|
38
|
+
error("Ok then. Goodbye.");
|
|
33
39
|
}
|
|
34
40
|
|
|
35
41
|
file.deleteFileOrDirectory(modTargetPath, verbose);
|
|
@@ -38,42 +38,19 @@ export function createMod(
|
|
|
38
38
|
configFile.createFile(projectPath, config, verbose);
|
|
39
39
|
const targetModDirectory = path.join(config.modsDirectory, projectName);
|
|
40
40
|
|
|
41
|
-
updateNodeModules(projectPath, verbose);
|
|
42
|
-
installNodeModules(projectPath, skipNPMInstall, verbose);
|
|
43
41
|
makeSubdirectories(projectPath, verbose);
|
|
44
42
|
copyStaticFiles(projectPath, verbose);
|
|
45
43
|
copyDynamicFiles(projectName, projectPath, targetModDirectory, verbose);
|
|
44
|
+
updateNodeModules(projectPath, verbose);
|
|
45
|
+
installNodeModules(projectPath, skipNPMInstall, verbose);
|
|
46
|
+
formatFiles(projectPath, verbose);
|
|
46
47
|
|
|
47
|
-
// Only make the initial commit once all of the files have been copied
|
|
48
|
+
// Only make the initial commit once all of the files have been copied and formatted
|
|
48
49
|
initGitRepository(projectPath, gitRemoteURL, verbose);
|
|
49
50
|
|
|
50
51
|
console.log(`Successfully created mod: ${chalk.green(projectName)}`);
|
|
51
52
|
}
|
|
52
53
|
|
|
53
|
-
function updateNodeModules(projectPath: string, verbose: boolean) {
|
|
54
|
-
console.log("Finding out the latest versions of the NPM packages...");
|
|
55
|
-
execShell(
|
|
56
|
-
"npx",
|
|
57
|
-
["npm-check-updates", "--upgrade", "--packageFile", "package.json"],
|
|
58
|
-
verbose,
|
|
59
|
-
false,
|
|
60
|
-
projectPath,
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function installNodeModules(
|
|
65
|
-
projectPath: string,
|
|
66
|
-
skipNPMInstall: boolean,
|
|
67
|
-
verbose: boolean,
|
|
68
|
-
) {
|
|
69
|
-
if (skipNPMInstall) {
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
console.log("Installing node modules... (This can take a long time.)");
|
|
74
|
-
execShell("npm", ["install"], verbose, false, projectPath);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
54
|
function makeSubdirectories(projectPath: string, verbose: boolean) {
|
|
78
55
|
// The "src" directory is created during copying of static files
|
|
79
56
|
for (const subdirectory of ["mod"]) {
|
|
@@ -84,11 +61,11 @@ function makeSubdirectories(projectPath: string, verbose: boolean) {
|
|
|
84
61
|
|
|
85
62
|
/** Copy static files, like ".eslintrc.js", "tsconfig.json", etc. */
|
|
86
63
|
function copyStaticFiles(projectPath: string, verbose: boolean) {
|
|
87
|
-
const staticFileList = file.getDirList(TEMPLATES_STATIC_DIR);
|
|
64
|
+
const staticFileList = file.getDirList(TEMPLATES_STATIC_DIR, verbose);
|
|
88
65
|
staticFileList.forEach((fileName: string) => {
|
|
89
66
|
const templateFilePath = path.join(TEMPLATES_STATIC_DIR, fileName);
|
|
90
67
|
const destinationFilePath = path.join(projectPath, fileName);
|
|
91
|
-
if (!file.exists(destinationFilePath)) {
|
|
68
|
+
if (!file.exists(destinationFilePath, verbose)) {
|
|
92
69
|
file.copy(templateFilePath, destinationFilePath, verbose);
|
|
93
70
|
}
|
|
94
71
|
});
|
|
@@ -105,7 +82,7 @@ function copyDynamicFiles(
|
|
|
105
82
|
{
|
|
106
83
|
const fileName = GITIGNORE;
|
|
107
84
|
const templatePath = GITIGNORE_TEMPLATE_PATH;
|
|
108
|
-
const template = file.read(templatePath);
|
|
85
|
+
const template = file.read(templatePath, verbose);
|
|
109
86
|
|
|
110
87
|
// Prepend a header with the project name
|
|
111
88
|
let separatorLine = "# ";
|
|
@@ -125,7 +102,7 @@ function copyDynamicFiles(
|
|
|
125
102
|
// Modify and copy the file
|
|
126
103
|
const fileName = PACKAGE_JSON;
|
|
127
104
|
const templatePath = PACKAGE_JSON_TEMPLATE_PATH;
|
|
128
|
-
const template = file.read(templatePath);
|
|
105
|
+
const template = file.read(templatePath, verbose);
|
|
129
106
|
const packageJSON = template.replace(/MOD_NAME_TO_REPLACE/g, projectName);
|
|
130
107
|
const destinationPath = path.join(projectPath, fileName);
|
|
131
108
|
file.write(destinationPath, packageJSON, verbose);
|
|
@@ -135,7 +112,7 @@ function copyDynamicFiles(
|
|
|
135
112
|
{
|
|
136
113
|
const fileName = README_MD;
|
|
137
114
|
const templatePath = README_MD_TEMPLATES_PATH;
|
|
138
|
-
const template = file.read(templatePath);
|
|
115
|
+
const template = file.read(templatePath, verbose);
|
|
139
116
|
const readmeMD = template.replace(/MOD_NAME_TO_REPLACE/g, projectName);
|
|
140
117
|
const destinationPath = path.join(projectPath, fileName);
|
|
141
118
|
file.write(destinationPath, readmeMD, verbose);
|
|
@@ -145,19 +122,18 @@ function copyDynamicFiles(
|
|
|
145
122
|
{
|
|
146
123
|
const fileName = METADATA_XML;
|
|
147
124
|
const templatePath = METADATA_XML_TEMPLATE_PATH;
|
|
148
|
-
const template = file.read(templatePath);
|
|
125
|
+
const template = file.read(templatePath, verbose);
|
|
149
126
|
const metadataXML = template.replace(/MOD_NAME_TO_REPLACE/g, projectName);
|
|
150
127
|
const modPath = path.join(projectPath, "mod");
|
|
151
128
|
const destinationPath = path.join(modPath, fileName);
|
|
152
129
|
file.write(destinationPath, metadataXML, verbose);
|
|
153
|
-
execShell("npx", ["prettier", "--write", destinationPath]);
|
|
154
130
|
}
|
|
155
131
|
|
|
156
132
|
// "mod/metadata.vdf"
|
|
157
133
|
{
|
|
158
134
|
const fileName = METADATA_VDF;
|
|
159
135
|
const templatePath = METADATA_VDF_TEMPLATE_PATH;
|
|
160
|
-
const template = file.read(templatePath);
|
|
136
|
+
const template = file.read(templatePath, verbose);
|
|
161
137
|
const metadataVDF = template.replace(/MOD_TARGET_DIR/g, targetModDirectory);
|
|
162
138
|
const modPath = path.join(projectPath, "mod");
|
|
163
139
|
const destinationPath = path.join(modPath, fileName);
|
|
@@ -171,10 +147,44 @@ function copyDynamicFiles(
|
|
|
171
147
|
const srcPath = path.join(projectPath, "src");
|
|
172
148
|
const fileName = MAIN_TS;
|
|
173
149
|
const templatePath = MAIN_TS_TEMPLATE_PATH;
|
|
174
|
-
const template = file.read(templatePath);
|
|
150
|
+
const template = file.read(templatePath, verbose);
|
|
175
151
|
const mainTS = template.replace(/MOD_NAME_TO_REPLACE/g, projectName);
|
|
176
152
|
const destinationPath = path.join(srcPath, fileName);
|
|
177
153
|
file.write(destinationPath, mainTS, verbose);
|
|
178
|
-
execShell("npx", ["prettier", "--write", destinationPath]);
|
|
179
154
|
}
|
|
180
155
|
}
|
|
156
|
+
|
|
157
|
+
/** The "package.json" file has to be copied first before this step. */
|
|
158
|
+
function updateNodeModules(projectPath: string, verbose: boolean) {
|
|
159
|
+
console.log("Finding out the latest versions of the NPM packages...");
|
|
160
|
+
execShell(
|
|
161
|
+
"npx",
|
|
162
|
+
["npm-check-updates", "--upgrade", "--packageFile", "package.json"],
|
|
163
|
+
verbose,
|
|
164
|
+
false,
|
|
165
|
+
projectPath,
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function installNodeModules(
|
|
170
|
+
projectPath: string,
|
|
171
|
+
skipNPMInstall: boolean,
|
|
172
|
+
verbose: boolean,
|
|
173
|
+
) {
|
|
174
|
+
if (skipNPMInstall) {
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
console.log("Installing node modules... (This can take a long time.)");
|
|
179
|
+
execShell("npm", ["install"], verbose, false, projectPath);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
function formatFiles(projectPath: string, verbose: boolean) {
|
|
183
|
+
execShell(
|
|
184
|
+
"npx",
|
|
185
|
+
["prettier", "--write", projectPath],
|
|
186
|
+
verbose,
|
|
187
|
+
false,
|
|
188
|
+
projectPath,
|
|
189
|
+
);
|
|
190
|
+
}
|
|
@@ -31,6 +31,7 @@ const DEFAULT_MODS_PATH_LINUX = path.join(
|
|
|
31
31
|
|
|
32
32
|
export async function getModsDir(
|
|
33
33
|
argv: Record<string, unknown>,
|
|
34
|
+
verbose: boolean,
|
|
34
35
|
): Promise<string> {
|
|
35
36
|
if (argv.modsDirectory !== undefined) {
|
|
36
37
|
// They specified the "--mods-directory" command-line flag,
|
|
@@ -40,7 +41,10 @@ export async function getModsDir(
|
|
|
40
41
|
|
|
41
42
|
const defaultModsPath = getDefaultModsPath(process.platform);
|
|
42
43
|
|
|
43
|
-
if (
|
|
44
|
+
if (
|
|
45
|
+
file.exists(defaultModsPath, verbose) &&
|
|
46
|
+
file.isDir(defaultModsPath, verbose)
|
|
47
|
+
) {
|
|
44
48
|
return defaultModsPath;
|
|
45
49
|
}
|
|
46
50
|
|
|
@@ -55,7 +59,7 @@ export async function getModsDir(
|
|
|
55
59
|
error("Error: You did not provide a response; exiting.");
|
|
56
60
|
}
|
|
57
61
|
|
|
58
|
-
if (!file.exists(modsDir)) {
|
|
62
|
+
if (!file.exists(modsDir, verbose)) {
|
|
59
63
|
error(
|
|
60
64
|
`Error: The directory of "${chalk.green(
|
|
61
65
|
modsDir,
|
|
@@ -63,7 +67,7 @@ export async function getModsDir(
|
|
|
63
67
|
);
|
|
64
68
|
}
|
|
65
69
|
|
|
66
|
-
if (!file.isDir(modsDir)) {
|
|
70
|
+
if (!file.isDir(modsDir, verbose)) {
|
|
67
71
|
error(
|
|
68
72
|
`Error: The path of "${chalk.green(
|
|
69
73
|
modsDir,
|