isaacscript 1.1.74 → 1.2.4
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 +6 -6
- package/dist/src/commands/copy/copy.js +13 -12
- package/dist/src/commands/copy/copy.js.map +1 -1
- package/dist/src/commands/init/checkIfProjectPathExists.js +2 -2
- package/dist/src/commands/init/checkIfProjectPathExists.js.map +1 -1
- package/dist/src/commands/init/checkModTargetDirectory.js +2 -2
- package/dist/src/commands/init/checkModTargetDirectory.js.map +1 -1
- package/dist/src/commands/init/createMod.js +55 -34
- package/dist/src/commands/init/createMod.js.map +1 -1
- package/dist/src/commands/init/init.js +10 -8
- package/dist/src/commands/init/init.js.map +1 -1
- package/dist/src/commands/init/installVSCodeExtensions.js +3 -2
- package/dist/src/commands/init/installVSCodeExtensions.js.map +1 -1
- package/dist/src/commands/init/promptVSCode.js +7 -7
- package/dist/src/commands/init/promptVSCode.js.map +1 -1
- package/dist/src/commands/monitor/copyWatcherMod.js +7 -7
- package/dist/src/commands/monitor/copyWatcherMod.js.map +1 -1
- package/dist/src/commands/monitor/modDirectorySyncer/modDirectorySyncer.js +4 -4
- package/dist/src/commands/monitor/modDirectorySyncer/modDirectorySyncer.js.map +1 -1
- package/dist/src/commands/monitor/monitor.js +4 -3
- package/dist/src/commands/monitor/monitor.js.map +1 -1
- package/dist/src/commands/monitor/saveDatWriter/saveDatWriter.js +1 -1
- package/dist/src/commands/monitor/saveDatWriter/saveDatWriter.js.map +1 -1
- package/dist/src/commands/monitor/touchWatcherSaveDatFiles.js +3 -3
- package/dist/src/commands/monitor/touchWatcherSaveDatFiles.js.map +1 -1
- package/dist/src/commands/publish/publish.js +48 -46
- package/dist/src/commands/publish/publish.js.map +1 -1
- package/dist/src/configFile.js +4 -3
- package/dist/src/configFile.js.map +1 -1
- package/dist/src/exec.js +79 -0
- package/dist/src/exec.js.map +1 -0
- package/dist/src/file.js +35 -5
- package/dist/src/file.js.map +1 -1
- package/dist/src/main.js +1 -1
- package/dist/src/main.js.map +1 -1
- package/dist/src/monkeyPatch.js +8 -14
- package/dist/src/monkeyPatch.js.map +1 -1
- package/dist/src/parseArgs.js +20 -1
- package/dist/src/parseArgs.js.map +1 -1
- package/dist/src/plugins/addCrashDebugStatements.js +1 -1
- package/dist/src/plugins/addCrashDebugStatements.js.map +1 -1
- package/dist/src/util.js +22 -57
- package/dist/src/util.js.map +1 -1
- package/dist/src/validateNodeVersion.js +6 -24
- package/dist/src/validateNodeVersion.js.map +1 -1
- package/package.json +6 -6
- package/publish.sh +1 -1
- package/src/commands/copy/copy.ts +20 -12
- package/src/commands/init/checkIfProjectPathExists.ts +2 -1
- package/src/commands/init/checkModTargetDirectory.ts +2 -1
- package/src/commands/init/createMod.ts +87 -29
- package/src/commands/init/init.ts +15 -7
- package/src/commands/init/installVSCodeExtensions.ts +4 -2
- package/src/commands/init/promptVSCode.ts +12 -7
- package/src/commands/monitor/copyWatcherMod.ts +10 -7
- package/src/commands/monitor/modDirectorySyncer/modDirectorySyncer.ts +3 -3
- package/src/commands/monitor/monitor.ts +5 -3
- package/src/commands/monitor/saveDatWriter/saveDatWriter.ts +1 -1
- package/src/commands/monitor/touchWatcherSaveDatFiles.ts +6 -3
- package/src/commands/publish/publish.ts +66 -55
- package/src/configFile.ts +9 -3
- package/src/exec.ts +102 -0
- package/src/file.ts +48 -5
- package/src/main.ts +1 -1
- package/src/monkeyPatch.ts +8 -13
- package/src/parseArgs.ts +22 -1
- package/src/plugins/addCrashDebugStatements.ts +1 -1
- package/src/util.ts +29 -79
- package/src/validateNodeVersion.ts +7 -39
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.4",
|
|
4
4
|
"description": "A command line tool for managing Isaac mods written in TypeScript",
|
|
5
5
|
"homepage": "https://isaacscript.github.io/",
|
|
6
6
|
"bugs": {
|
|
@@ -16,21 +16,21 @@
|
|
|
16
16
|
"isaacscript": "./dist/src/main.js"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
+
"@zamiell/typescript-to-lua": "^1.4.0",
|
|
19
20
|
"chalk": "4.1.2",
|
|
20
21
|
"command-exists": "^1.2.9",
|
|
21
|
-
"dotenv": "^
|
|
22
|
+
"dotenv": "^16.0.0",
|
|
22
23
|
"figlet": "^1.5.2",
|
|
23
24
|
"fs-extra": "^10.0.0",
|
|
24
25
|
"isaacscript-tsconfig": "^1.1.8",
|
|
25
26
|
"jsonc-parser": "^3.0.0",
|
|
26
27
|
"moment": "^2.29.1",
|
|
27
|
-
"npm-check-updates": "^12.
|
|
28
|
-
"prompt": "^1.2.
|
|
28
|
+
"npm-check-updates": "^12.3.1",
|
|
29
|
+
"prompt": "^1.2.2",
|
|
29
30
|
"source-map": "^0.7.3",
|
|
30
31
|
"source-map-support": "^0.5.21",
|
|
31
32
|
"sync-directory": "^4.0.12",
|
|
32
33
|
"typescript": "^4.5.5",
|
|
33
|
-
"typescript-to-lua": "^1.3.3",
|
|
34
34
|
"update-notifier": "^5.1.0",
|
|
35
35
|
"yaml": "^1.10.2",
|
|
36
36
|
"yargs": "^17.3.1"
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@types/command-exists": "^1.2.0",
|
|
40
40
|
"@types/figlet": "^1.5.4",
|
|
41
41
|
"@types/fs-extra": "^9.0.13",
|
|
42
|
-
"@types/node": "^17.0.
|
|
42
|
+
"@types/node": "^17.0.18",
|
|
43
43
|
"@types/prompt": "^1.1.2",
|
|
44
44
|
"@types/source-map-support": "^0.5.4",
|
|
45
45
|
"@types/update-notifier": "^5.1.0",
|
|
@@ -25,30 +25,31 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
25
25
|
exports.compileAndCopy = exports.copy = void 0;
|
|
26
26
|
const path_1 = __importDefault(require("path"));
|
|
27
27
|
const constants_1 = require("../../constants");
|
|
28
|
+
const exec_1 = require("../../exec");
|
|
28
29
|
const file = __importStar(require("../../file"));
|
|
29
|
-
const monkeyPatch_1 = require("../../monkeyPatch");
|
|
30
30
|
const util_1 = require("../../util");
|
|
31
|
-
function copy(config) {
|
|
31
|
+
function copy(argv, config) {
|
|
32
|
+
const verbose = argv.verbose === true;
|
|
32
33
|
const modTargetDirectoryName = (0, util_1.getModTargetDirectoryName)(config);
|
|
33
34
|
const modTargetPath = path_1.default.join(config.modsDirectory, modTargetDirectoryName);
|
|
34
|
-
compileAndCopy(constants_1.MOD_SOURCE_PATH, modTargetPath);
|
|
35
|
+
compileAndCopy(constants_1.MOD_SOURCE_PATH, modTargetPath, verbose);
|
|
35
36
|
}
|
|
36
37
|
exports.copy = copy;
|
|
37
|
-
function compileAndCopy(modSourcePath, modTargetPath) {
|
|
38
|
-
compile();
|
|
39
|
-
|
|
40
|
-
copyMod(modSourcePath, modTargetPath);
|
|
38
|
+
function compileAndCopy(modSourcePath, modTargetPath, verbose) {
|
|
39
|
+
compile(verbose);
|
|
40
|
+
// monkeyPatchMainLua(modSourcePath);
|
|
41
|
+
copyMod(modSourcePath, modTargetPath, verbose);
|
|
41
42
|
}
|
|
42
43
|
exports.compileAndCopy = compileAndCopy;
|
|
43
|
-
function compile() {
|
|
44
|
-
(0,
|
|
44
|
+
function compile(verbose) {
|
|
45
|
+
(0, exec_1.execShell)("npx", ["tstl"], verbose);
|
|
45
46
|
console.log("Mod compiled successfully.");
|
|
46
47
|
}
|
|
47
|
-
function copyMod(modSourcePath, modTargetPath) {
|
|
48
|
+
function copyMod(modSourcePath, modTargetPath, verbose) {
|
|
48
49
|
if (file.exists(modTargetPath)) {
|
|
49
|
-
file.deleteFileOrDirectory(modTargetPath);
|
|
50
|
+
file.deleteFileOrDirectory(modTargetPath, verbose);
|
|
50
51
|
}
|
|
51
|
-
file.copy(modSourcePath, modTargetPath);
|
|
52
|
+
file.copy(modSourcePath, modTargetPath, verbose);
|
|
52
53
|
console.log("Mod copied successfully.");
|
|
53
54
|
}
|
|
54
55
|
//# sourceMappingURL=copy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy.js","sourceRoot":"","sources":["../../../../src/commands/copy/copy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAwB;AACxB,+CAAkD;AAClD,iDAAmC;
|
|
1
|
+
{"version":3,"file":"copy.js","sourceRoot":"","sources":["../../../../src/commands/copy/copy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAwB;AACxB,+CAAkD;AAClD,qCAAuC;AACvC,iDAAmC;AAEnC,qCAAuD;AAEvD,SAAgB,IAAI,CAAC,IAA6B,EAAE,MAAc;IAChE,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC;IAEtC,MAAM,sBAAsB,GAAG,IAAA,gCAAyB,EAAC,MAAM,CAAC,CAAC;IACjE,MAAM,aAAa,GAAG,cAAI,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,sBAAsB,CAAC,CAAC;IAE9E,cAAc,CAAC,2BAAe,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC;AAC1D,CAAC;AAPD,oBAOC;AAED,SAAgB,cAAc,CAC5B,aAAqB,EACrB,aAAqB,EACrB,OAAgB;IAEhB,OAAO,CAAC,OAAO,CAAC,CAAC;IACjB,qCAAqC;IACrC,OAAO,CAAC,aAAa,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC;AACjD,CAAC;AARD,wCAQC;AAED,SAAS,OAAO,CAAC,OAAgB;IAC/B,IAAA,gBAAS,EAAC,KAAK,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC;IACpC,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;AAC5C,CAAC;AAED,SAAS,OAAO,CACd,aAAqB,EACrB,aAAqB,EACrB,OAAgB;IAEhB,IAAI,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE;QAC9B,IAAI,CAAC,qBAAqB,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;KACpD;IACD,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC;IACjD,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -28,7 +28,7 @@ const constants_1 = require("../../constants");
|
|
|
28
28
|
const file = __importStar(require("../../file"));
|
|
29
29
|
const prompt_1 = require("../../prompt");
|
|
30
30
|
const util_1 = require("../../util");
|
|
31
|
-
async function checkIfProjectPathExists(projectPath) {
|
|
31
|
+
async function checkIfProjectPathExists(projectPath, verbose) {
|
|
32
32
|
if (projectPath !== constants_1.CWD && file.exists(projectPath)) {
|
|
33
33
|
const fileType = file.isDir(projectPath) ? "directory" : "file";
|
|
34
34
|
console.log(`A ${fileType} already exists with a name of "${chalk_1.default.green(projectPath)}".`);
|
|
@@ -36,7 +36,7 @@ async function checkIfProjectPathExists(projectPath) {
|
|
|
36
36
|
if (!shouldDelete) {
|
|
37
37
|
(0, util_1.error)("Ok then. Good-bye.");
|
|
38
38
|
}
|
|
39
|
-
file.deleteFileOrDirectory(projectPath);
|
|
39
|
+
file.deleteFileOrDirectory(projectPath, verbose);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
exports.checkIfProjectPathExists = checkIfProjectPathExists;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkIfProjectPathExists.js","sourceRoot":"","sources":["../../../../src/commands/init/checkIfProjectPathExists.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,+CAAsC;AACtC,iDAAmC;AACnC,yCAA6C;AAC7C,qCAAmC;AAE5B,KAAK,UAAU,wBAAwB,CAC5C,WAAmB;
|
|
1
|
+
{"version":3,"file":"checkIfProjectPathExists.js","sourceRoot":"","sources":["../../../../src/commands/init/checkIfProjectPathExists.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,+CAAsC;AACtC,iDAAmC;AACnC,yCAA6C;AAC7C,qCAAmC;AAE5B,KAAK,UAAU,wBAAwB,CAC5C,WAAmB,EACnB,OAAgB;IAEhB,IAAI,WAAW,KAAK,eAAG,IAAI,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE;QACnD,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC;QAChE,OAAO,CAAC,GAAG,CACT,KAAK,QAAQ,mCAAmC,eAAK,CAAC,KAAK,CACzD,WAAW,CACZ,IAAI,CACN,CAAC;QAEF,MAAM,YAAY,GAAG,MAAM,IAAA,sBAAa,EAAC,8BAA8B,CAAC,CAAC;QAEzE,IAAI,CAAC,YAAY,EAAE;YACjB,IAAA,YAAK,EAAC,oBAAoB,CAAC,CAAC;SAC7B;QAED,IAAI,CAAC,qBAAqB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;KAClD;AACH,CAAC;AApBD,4DAoBC"}
|
|
@@ -29,7 +29,7 @@ const constants_1 = require("../../constants");
|
|
|
29
29
|
const file = __importStar(require("../../file"));
|
|
30
30
|
const prompt_1 = require("../../prompt");
|
|
31
31
|
const util_1 = require("../../util");
|
|
32
|
-
async function checkModTargetDirectory(modsDirectory, projectName) {
|
|
32
|
+
async function checkModTargetDirectory(modsDirectory, projectName, verbose) {
|
|
33
33
|
const modTargetPath = path_1.default.join(modsDirectory, projectName);
|
|
34
34
|
if (!file.exists(modTargetPath)) {
|
|
35
35
|
return;
|
|
@@ -40,7 +40,7 @@ async function checkModTargetDirectory(modsDirectory, projectName) {
|
|
|
40
40
|
if (!shouldDeleteDirectory) {
|
|
41
41
|
(0, util_1.error)("Ok then. You delete it yourself. Good bye.");
|
|
42
42
|
}
|
|
43
|
-
file.deleteFileOrDirectory(modTargetPath);
|
|
43
|
+
file.deleteFileOrDirectory(modTargetPath, verbose);
|
|
44
44
|
}
|
|
45
45
|
exports.checkModTargetDirectory = checkModTargetDirectory;
|
|
46
46
|
//# sourceMappingURL=checkModTargetDirectory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkModTargetDirectory.js","sourceRoot":"","sources":["../../../../src/commands/init/checkModTargetDirectory.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,gDAAwB;AACxB,+CAA+C;AAC/C,iDAAmC;AACnC,yCAA6C;AAC7C,qCAAmC;AAE5B,KAAK,UAAU,uBAAuB,CAC3C,aAAqB,EACrB,WAAmB;
|
|
1
|
+
{"version":3,"file":"checkModTargetDirectory.js","sourceRoot":"","sources":["../../../../src/commands/init/checkModTargetDirectory.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,gDAAwB;AACxB,+CAA+C;AAC/C,iDAAmC;AACnC,yCAA6C;AAC7C,qCAAmC;AAE5B,KAAK,UAAU,uBAAuB,CAC3C,aAAqB,EACrB,WAAmB,EACnB,OAAgB;IAEhB,MAAM,aAAa,GAAG,cAAI,CAAC,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;IAC5D,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE;QAC/B,OAAO;KACR;IAED,OAAO,CAAC,KAAK,CACX,kCAAkC,eAAK,CAAC,KAAK,CAC3C,aAAa,CACd,mBAAmB,CACrB,CAAC;IACF,OAAO,CAAC,KAAK,CACX,gBAAgB,wBAAY,4FAA4F,CACzH,CAAC;IAEF,MAAM,qBAAqB,GAAG,MAAM,IAAA,sBAAa,EAC/C,gHAAgH,CACjH,CAAC;IAEF,IAAI,CAAC,qBAAqB,EAAE;QAC1B,IAAA,YAAK,EAAC,4CAA4C,CAAC,CAAC;KACrD;IAED,IAAI,CAAC,qBAAqB,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;AACrD,CAAC;AA5BD,0DA4BC"}
|
|
@@ -29,45 +29,48 @@ const path_1 = __importDefault(require("path"));
|
|
|
29
29
|
const yaml_1 = __importDefault(require("yaml"));
|
|
30
30
|
const configFile = __importStar(require("../../configFile"));
|
|
31
31
|
const constants_1 = require("../../constants");
|
|
32
|
+
const exec_1 = require("../../exec");
|
|
32
33
|
const file = __importStar(require("../../file"));
|
|
33
34
|
const prompt_1 = require("../../prompt");
|
|
34
35
|
const util_1 = require("../../util");
|
|
35
|
-
|
|
36
|
+
const REQUIRED_GIT_MAJOR_VERSION = 2;
|
|
37
|
+
const REQUIRED_GIT_MINOR_VERSION = 30;
|
|
38
|
+
async function createMod(projectName, projectPath, createNewDir, modsDirectory, saveSlot, skipNPMInstall, verbose) {
|
|
36
39
|
if (createNewDir) {
|
|
37
|
-
file.makeDir(projectPath);
|
|
40
|
+
file.makeDir(projectPath, verbose);
|
|
38
41
|
}
|
|
39
42
|
const config = configFile.createObject(modsDirectory, saveSlot);
|
|
40
|
-
configFile.createFile(projectPath, config);
|
|
43
|
+
configFile.createFile(projectPath, config, verbose);
|
|
41
44
|
const targetModDirectory = path_1.default.join(config.modsDirectory, projectName);
|
|
42
|
-
makeSubdirectories(projectPath);
|
|
43
|
-
copyStaticFiles(projectPath);
|
|
44
|
-
copyDynamicFiles(projectName, projectPath, targetModDirectory);
|
|
45
|
-
updateNodeModules(projectPath);
|
|
46
|
-
await initGitRepository(projectPath, projectName);
|
|
47
|
-
installNodeModules(projectPath, skipNPMInstall);
|
|
45
|
+
makeSubdirectories(projectPath, verbose);
|
|
46
|
+
copyStaticFiles(projectPath, verbose);
|
|
47
|
+
copyDynamicFiles(projectName, projectPath, targetModDirectory, verbose);
|
|
48
|
+
updateNodeModules(projectPath, verbose);
|
|
49
|
+
await initGitRepository(projectPath, projectName, verbose);
|
|
50
|
+
installNodeModules(projectPath, skipNPMInstall, verbose);
|
|
48
51
|
console.log(`Successfully created mod: ${chalk_1.default.green(projectName)}`);
|
|
49
52
|
}
|
|
50
53
|
exports.createMod = createMod;
|
|
51
|
-
function makeSubdirectories(projectPath) {
|
|
54
|
+
function makeSubdirectories(projectPath, verbose) {
|
|
52
55
|
// The "src" directory is created during copying of static files
|
|
53
56
|
for (const subdirectory of ["mod"]) {
|
|
54
57
|
const srcPath = path_1.default.join(projectPath, subdirectory);
|
|
55
|
-
file.makeDir(srcPath);
|
|
58
|
+
file.makeDir(srcPath, verbose);
|
|
56
59
|
}
|
|
57
60
|
}
|
|
58
61
|
// Copy static files, like ".eslintrc.js", "tsconfig.json", etc.
|
|
59
|
-
function copyStaticFiles(projectPath) {
|
|
62
|
+
function copyStaticFiles(projectPath, verbose) {
|
|
60
63
|
const staticFileList = file.getDirList(constants_1.TEMPLATES_STATIC_DIR);
|
|
61
64
|
staticFileList.forEach((fileName) => {
|
|
62
65
|
const templateFilePath = path_1.default.join(constants_1.TEMPLATES_STATIC_DIR, fileName);
|
|
63
66
|
const destinationFilePath = path_1.default.join(projectPath, fileName);
|
|
64
67
|
if (!file.exists(destinationFilePath)) {
|
|
65
|
-
file.copy(templateFilePath, destinationFilePath);
|
|
68
|
+
file.copy(templateFilePath, destinationFilePath, verbose);
|
|
66
69
|
}
|
|
67
70
|
});
|
|
68
71
|
}
|
|
69
72
|
// Copy files that need to have text replaced inside of them
|
|
70
|
-
function copyDynamicFiles(projectName, projectPath, targetModDirectory) {
|
|
73
|
+
function copyDynamicFiles(projectName, projectPath, targetModDirectory, verbose) {
|
|
71
74
|
// ".gitignore"
|
|
72
75
|
{
|
|
73
76
|
const fileName = constants_1.GITIGNORE;
|
|
@@ -82,7 +85,7 @@ function copyDynamicFiles(projectName, projectPath, targetModDirectory) {
|
|
|
82
85
|
const gitignoreHeader = `${separatorLine}# ${projectName}\n${separatorLine}\n`;
|
|
83
86
|
const gitignore = gitignoreHeader + template;
|
|
84
87
|
const destinationPath = path_1.default.join(projectPath, `.${fileName}`); // We need to prepend a period
|
|
85
|
-
file.write(destinationPath, gitignore);
|
|
88
|
+
file.write(destinationPath, gitignore, verbose);
|
|
86
89
|
}
|
|
87
90
|
// "package.json"
|
|
88
91
|
{
|
|
@@ -92,7 +95,7 @@ function copyDynamicFiles(projectName, projectPath, targetModDirectory) {
|
|
|
92
95
|
const template = file.read(templatePath);
|
|
93
96
|
const packageJSON = template.replace(/MOD_NAME_TO_REPLACE/g, projectName);
|
|
94
97
|
const destinationPath = path_1.default.join(projectPath, fileName);
|
|
95
|
-
file.write(destinationPath, packageJSON);
|
|
98
|
+
file.write(destinationPath, packageJSON, verbose);
|
|
96
99
|
}
|
|
97
100
|
// "README.md"
|
|
98
101
|
{
|
|
@@ -101,7 +104,7 @@ function copyDynamicFiles(projectName, projectPath, targetModDirectory) {
|
|
|
101
104
|
const template = file.read(templatePath);
|
|
102
105
|
const readmeMD = template.replace(/MOD_NAME_TO_REPLACE/g, projectName);
|
|
103
106
|
const destinationPath = path_1.default.join(projectPath, fileName);
|
|
104
|
-
file.write(destinationPath, readmeMD);
|
|
107
|
+
file.write(destinationPath, readmeMD, verbose);
|
|
105
108
|
}
|
|
106
109
|
// "mod/metadata.xml"
|
|
107
110
|
{
|
|
@@ -111,7 +114,7 @@ function copyDynamicFiles(projectName, projectPath, targetModDirectory) {
|
|
|
111
114
|
const metadataXML = template.replace(/MOD_NAME_TO_REPLACE/g, projectName);
|
|
112
115
|
const modPath = path_1.default.join(projectPath, "mod");
|
|
113
116
|
const destinationPath = path_1.default.join(modPath, fileName);
|
|
114
|
-
file.write(destinationPath, metadataXML);
|
|
117
|
+
file.write(destinationPath, metadataXML, verbose);
|
|
115
118
|
}
|
|
116
119
|
// "mod/metadata.vdf"
|
|
117
120
|
{
|
|
@@ -121,7 +124,7 @@ function copyDynamicFiles(projectName, projectPath, targetModDirectory) {
|
|
|
121
124
|
const metadataVDF = template.replace(/MOD_TARGET_DIR/g, targetModDirectory);
|
|
122
125
|
const modPath = path_1.default.join(projectPath, "mod");
|
|
123
126
|
const destinationPath = path_1.default.join(modPath, fileName);
|
|
124
|
-
file.write(destinationPath, metadataVDF);
|
|
127
|
+
file.write(destinationPath, metadataVDF, verbose);
|
|
125
128
|
}
|
|
126
129
|
// "src/main.ts"
|
|
127
130
|
{
|
|
@@ -133,28 +136,29 @@ function copyDynamicFiles(projectName, projectPath, targetModDirectory) {
|
|
|
133
136
|
const template = file.read(templatePath);
|
|
134
137
|
const mainTS = template.replace(/MOD_NAME_TO_REPLACE/g, projectName);
|
|
135
138
|
const destinationPath = path_1.default.join(srcPath, fileName);
|
|
136
|
-
file.write(destinationPath, mainTS);
|
|
139
|
+
file.write(destinationPath, mainTS, verbose);
|
|
137
140
|
}
|
|
138
141
|
}
|
|
139
|
-
function updateNodeModules(projectPath) {
|
|
142
|
+
function updateNodeModules(projectPath, verbose) {
|
|
140
143
|
console.log("Finding out the latest versions of the NPM packages...");
|
|
141
|
-
(0,
|
|
144
|
+
(0, exec_1.execShell)("npx", ["npm-check-updates", "--upgrade", "--packageFile", "package.json"], verbose, false, projectPath);
|
|
142
145
|
}
|
|
143
|
-
async function initGitRepository(projectPath, projectName) {
|
|
146
|
+
async function initGitRepository(projectPath, projectName, verbose) {
|
|
144
147
|
if (!command_exists_1.default.sync("git")) {
|
|
145
148
|
console.log('Git does not seem to be installed. (The "git" command is not in the path.) Skipping Git-related things.');
|
|
146
149
|
return;
|
|
147
150
|
}
|
|
151
|
+
checkOldGitVersion(verbose);
|
|
148
152
|
const remoteURL = await getGitRemoteURL(projectName);
|
|
149
153
|
if (remoteURL === "") {
|
|
150
154
|
return;
|
|
151
155
|
}
|
|
152
|
-
(0,
|
|
153
|
-
(0,
|
|
154
|
-
(0,
|
|
155
|
-
if (isGitNameAndEmailConfigured()) {
|
|
156
|
-
(0,
|
|
157
|
-
(0,
|
|
156
|
+
(0, exec_1.execShell)("git", ["init"], verbose, false, projectPath);
|
|
157
|
+
(0, exec_1.execShell)("git", ["branch", "-M", "main"], verbose, false, projectPath);
|
|
158
|
+
(0, exec_1.execShell)("git", ["remote", "add", "origin", remoteURL], verbose, false, projectPath);
|
|
159
|
+
if (isGitNameAndEmailConfigured(verbose)) {
|
|
160
|
+
(0, exec_1.execShell)("git", ["add", "--all"], verbose, false, projectPath);
|
|
161
|
+
(0, exec_1.execShell)("git", ["commit", "--message", `${constants_1.PROJECT_NAME} template`], verbose, false, projectPath);
|
|
158
162
|
}
|
|
159
163
|
}
|
|
160
164
|
async function getGitRemoteURL(projectName) {
|
|
@@ -173,6 +177,23 @@ ${chalk_1.default.green("https://github.com/Alice/green-candle.git")}
|
|
|
173
177
|
If you don't want to initialize a Git repository for this project, press enter to skip.
|
|
174
178
|
`);
|
|
175
179
|
}
|
|
180
|
+
function checkOldGitVersion(verbose) {
|
|
181
|
+
const [, stdout] = (0, exec_1.execShell)("git", ["--version"], verbose);
|
|
182
|
+
const outputPrefix = "git version ";
|
|
183
|
+
if (!stdout.startsWith(outputPrefix)) {
|
|
184
|
+
(0, util_1.error)(`Failed to parse the output from the "git --version" command: ${stdout}`);
|
|
185
|
+
}
|
|
186
|
+
const gitVersionString = stdout.slice(outputPrefix.length);
|
|
187
|
+
const [majorVersion, minorVersion] = (0, util_1.parseSemVer)(gitVersionString);
|
|
188
|
+
if (majorVersion >= REQUIRED_GIT_MAJOR_VERSION &&
|
|
189
|
+
minorVersion >= REQUIRED_GIT_MINOR_VERSION) {
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
console.error(`Your Git version is: ${chalk_1.default.red(gitVersionString)}`);
|
|
193
|
+
console.error(`${constants_1.PROJECT_NAME} requires a Git version of ${chalk_1.default.red(`${REQUIRED_GIT_MAJOR_VERSION}.${REQUIRED_GIT_MINOR_VERSION}.0`)} or greater.`);
|
|
194
|
+
console.error(`Please upgrade your version of Git before using ${constants_1.PROJECT_NAME}.`);
|
|
195
|
+
process.exit(1);
|
|
196
|
+
}
|
|
176
197
|
function guessRemoteURL(projectName) {
|
|
177
198
|
const gitHubUsername = getGitHubUsername();
|
|
178
199
|
if (gitHubUsername === undefined) {
|
|
@@ -203,16 +224,16 @@ function getGitHubUsername() {
|
|
|
203
224
|
}
|
|
204
225
|
return user;
|
|
205
226
|
}
|
|
206
|
-
function isGitNameAndEmailConfigured() {
|
|
207
|
-
const [nameExitStatus] = (0,
|
|
208
|
-
const [emailExitStatus] = (0,
|
|
227
|
+
function isGitNameAndEmailConfigured(verbose) {
|
|
228
|
+
const [nameExitStatus] = (0, exec_1.execShell)("git", ["config", "--global", "user.name"], verbose, true);
|
|
229
|
+
const [emailExitStatus] = (0, exec_1.execShell)("git", ["config", "--global", "user.email"], verbose, true);
|
|
209
230
|
return nameExitStatus === 0 && emailExitStatus === 0;
|
|
210
231
|
}
|
|
211
|
-
function installNodeModules(projectPath, skipNPMInstall) {
|
|
232
|
+
function installNodeModules(projectPath, skipNPMInstall, verbose) {
|
|
212
233
|
if (skipNPMInstall) {
|
|
213
234
|
return;
|
|
214
235
|
}
|
|
215
236
|
console.log("Installing node modules... (This can take a long time.)");
|
|
216
|
-
(0,
|
|
237
|
+
(0, exec_1.execShell)("npm", ["install"], verbose, false, projectPath);
|
|
217
238
|
}
|
|
218
239
|
//# sourceMappingURL=createMod.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createMod.js","sourceRoot":"","sources":["../../../../src/commands/init/createMod.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,oEAA2C;AAC3C,gDAAwB;AACxB,gDAAwB;AACxB,6DAA+C;AAC/C,+CAeyB;AACzB,iDAAmC;AACnC,yCAA6D;AAE7D,
|
|
1
|
+
{"version":3,"file":"createMod.js","sourceRoot":"","sources":["../../../../src/commands/init/createMod.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,oEAA2C;AAC3C,gDAAwB;AACxB,gDAAwB;AACxB,6DAA+C;AAC/C,+CAeyB;AACzB,qCAAuC;AACvC,iDAAmC;A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AED,SAAS,2BAA2B,CAAC,OAAgB;IACnD,MAAM,CAAC,cAAc,CAAC,GAAG,IAAA,gBAAS,EAChC,KAAK,EACL,CAAC,QAAQ,EAAE,UAAU,EAAE,WAAW,CAAC,EACnC,OAAO,EACP,IAAI,CACL,CAAC;IAEF,MAAM,CAAC,eAAe,CAAC,GAAG,IAAA,gBAAS,EACjC,KAAK,EACL,CAAC,QAAQ,EAAE,UAAU,EAAE,YAAY,CAAC,EACpC,OAAO,EACP,IAAI,CACL,CAAC;IAEF,OAAO,cAAc,KAAK,CAAC,IAAI,eAAe,KAAK,CAAC,CAAC;AACvD,CAAC;AAED,SAAS,kBAAkB,CACzB,WAAmB,EACnB,cAAuB,EACvB,OAAgB;IAEhB,IAAI,cAAc,EAAE;QAClB,OAAO;KACR;IAED,OAAO,CAAC,GAAG,CAAC,yDAAyD,CAAC,CAAC;IACvE,IAAA,gBAAS,EAAC,KAAK,EAAE,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC;AAC7D,CAAC"}
|
|
@@ -18,28 +18,30 @@ const installVSCodeExtensions_1 = require("./installVSCodeExtensions");
|
|
|
18
18
|
const promptSaveSlot_1 = require("./promptSaveSlot");
|
|
19
19
|
const promptVSCode_1 = require("./promptVSCode");
|
|
20
20
|
async function init(argv) {
|
|
21
|
+
const vscode = argv.vscode === true;
|
|
22
|
+
const skipNPMInstall = argv.skipNpmInstall === true;
|
|
23
|
+
const verbose = argv.verbose === true;
|
|
21
24
|
// Prompt the end-user for some information (and validate it as we go)
|
|
22
25
|
const [projectPath, createNewDir] = await (0, getProjectPath_1.getProjectPath)(argv);
|
|
23
|
-
await (0, checkIfProjectPathExists_1.checkIfProjectPathExists)(projectPath);
|
|
26
|
+
await (0, checkIfProjectPathExists_1.checkIfProjectPathExists)(projectPath, verbose);
|
|
24
27
|
const modsDirectory = await (0, getModsDir_1.getModsDir)(argv);
|
|
25
28
|
(0, checkModSubdirectory_1.checkModSubdirectory)(projectPath, modsDirectory);
|
|
26
29
|
const projectName = path_1.default.basename(projectPath);
|
|
27
|
-
await (0, checkModTargetDirectory_1.checkModTargetDirectory)(modsDirectory, projectName);
|
|
30
|
+
await (0, checkModTargetDirectory_1.checkModTargetDirectory)(modsDirectory, projectName, verbose);
|
|
28
31
|
const saveSlot = await (0, promptSaveSlot_1.promptSaveSlot)(argv);
|
|
29
|
-
|
|
30
|
-
await (
|
|
31
|
-
await openVSCode(projectPath, argv);
|
|
32
|
+
await (0, createMod_1.createMod)(projectName, projectPath, createNewDir, modsDirectory, saveSlot, skipNPMInstall, verbose);
|
|
33
|
+
await openVSCode(projectPath, vscode, verbose);
|
|
32
34
|
printFinishMessage(projectPath, projectName);
|
|
33
35
|
}
|
|
34
36
|
exports.init = init;
|
|
35
|
-
async function openVSCode(projectPath,
|
|
37
|
+
async function openVSCode(projectPath, vscode, verbose) {
|
|
36
38
|
const VSCodeCommand = getVSCodeCommand();
|
|
37
39
|
if (VSCodeCommand === null) {
|
|
38
40
|
console.log('VSCode does not seem to be installed. (The "code" command is not in the path.) Skipping VSCode-related things.');
|
|
39
41
|
return;
|
|
40
42
|
}
|
|
41
|
-
(0, installVSCodeExtensions_1.installVSCodeExtensions)(projectPath, VSCodeCommand);
|
|
42
|
-
await (0, promptVSCode_1.promptVSCode)(projectPath,
|
|
43
|
+
(0, installVSCodeExtensions_1.installVSCodeExtensions)(projectPath, VSCodeCommand, verbose);
|
|
44
|
+
await (0, promptVSCode_1.promptVSCode)(projectPath, VSCodeCommand, vscode, verbose);
|
|
43
45
|
}
|
|
44
46
|
function getVSCodeCommand() {
|
|
45
47
|
for (const VSCodeCommand of ["code", "codium", "code-oss", "code-insiders"]) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../../src/commands/init/init.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,oEAA2C;AAC3C,gDAAwB;AACxB,+CAAoD;AACpD,yE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C,GAAG,CAAC;IACxD,OAAO,CAAC,GAAG,CAAC,cAAc,wBAAY,cAAc,cAAc,GAAG,CAAC,CAAC;AACzE,CAAC"}
|
|
@@ -26,12 +26,13 @@ exports.installVSCodeExtensions = void 0;
|
|
|
26
26
|
const chalk_1 = __importDefault(require("chalk"));
|
|
27
27
|
const JSONC = __importStar(require("jsonc-parser"));
|
|
28
28
|
const path_1 = __importDefault(require("path"));
|
|
29
|
+
const exec_1 = require("../../exec");
|
|
29
30
|
const file = __importStar(require("../../file"));
|
|
30
31
|
const util_1 = require("../../util");
|
|
31
|
-
function installVSCodeExtensions(projectPath, VSCodeCommand) {
|
|
32
|
+
function installVSCodeExtensions(projectPath, VSCodeCommand, verbose) {
|
|
32
33
|
const extensions = getExtensionsFromJSON(projectPath);
|
|
33
34
|
for (const extensionName of extensions) {
|
|
34
|
-
(0,
|
|
35
|
+
(0, exec_1.execShell)(VSCodeCommand, ["--install-extension", extensionName], verbose);
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
38
|
exports.installVSCodeExtensions = installVSCodeExtensions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installVSCodeExtensions.js","sourceRoot":"","sources":["../../../../src/commands/init/installVSCodeExtensions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,oDAAsC;AACtC,gDAAwB;AACxB,iDAAmC;AACnC,
|
|
1
|
+
{"version":3,"file":"installVSCodeExtensions.js","sourceRoot":"","sources":["../../../../src/commands/init/installVSCodeExtensions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,oDAAsC;AACtC,gDAAwB;AACxB,qCAAuC;AACvC,iDAAmC;AACnC,qCAAmC;AAEnC,SAAgB,uBAAuB,CACrC,WAAmB,EACnB,aAAqB,EACrB,OAAgB;IAEhB,MAAM,UAAU,GAAG,qBAAqB,CAAC,WAAW,CAAC,CAAC;IACtD,KAAK,MAAM,aAAa,IAAI,UAAU,EAAE;QACtC,IAAA,gBAAS,EAAC,aAAa,EAAE,CAAC,qBAAqB,EAAE,aAAa,CAAC,EAAE,OAAO,CAAC,CAAC;KAC3E;AACH,CAAC;AATD,0DASC;AAMD,SAAS,qBAAqB,CAAC,WAAmB;IAChD,MAAM,kBAAkB,GAAG,cAAI,CAAC,IAAI,CAClC,WAAW,EACX,SAAS,EACT,iBAAiB,CAClB,CAAC;IAEF,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,EAAE;QACpC,OAAO,EAAE,CAAC;KACX;IAED,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IAExD,IAAI,cAA8B,CAAC;IACnC,IAAI;QACF,cAAc,GAAG,KAAK,CAAC,KAAK,CAAC,iBAAiB,CAAmB,CAAC;KACnE;IAAC,OAAO,GAAG,EAAE;QACZ,IAAA,YAAK,EACH,wBAAwB,eAAK,CAAC,KAAK,CAAC,kBAAkB,CAAC,SAAS,EAChE,GAAG,CACJ,CAAC;KACH;IAED,OAAO,cAAc,CAAC,eAAe,CAAC;AACxC,CAAC"}
|
|
@@ -6,23 +6,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.promptVSCode = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
8
|
const constants_1 = require("../../constants");
|
|
9
|
+
const exec_1 = require("../../exec");
|
|
9
10
|
const prompt_1 = require("../../prompt");
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
if (argv.vscode !== undefined) {
|
|
11
|
+
async function promptVSCode(projectPath, VSCodeCommand, vscode, verbose) {
|
|
12
|
+
if (vscode) {
|
|
13
13
|
// They supplied the "--vscode" command-line flag,
|
|
14
14
|
// so there is no need to prompt the user
|
|
15
|
-
openVSCode(projectPath, VSCodeCommand);
|
|
15
|
+
openVSCode(projectPath, VSCodeCommand, verbose);
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
18
|
const shouldOpenVSCode = await (0, prompt_1.getInputYesNo)("Do you want to open your new project in VSCode now?");
|
|
19
19
|
if (shouldOpenVSCode) {
|
|
20
|
-
openVSCode(projectPath, VSCodeCommand);
|
|
20
|
+
openVSCode(projectPath, VSCodeCommand, verbose);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
exports.promptVSCode = promptVSCode;
|
|
24
|
-
function openVSCode(projectPath, VSCodeCommand) {
|
|
24
|
+
function openVSCode(projectPath, VSCodeCommand, verbose) {
|
|
25
25
|
const MAIN_TS_PATH = path_1.default.join(projectPath, "src", constants_1.MAIN_TS);
|
|
26
|
-
(0,
|
|
26
|
+
(0, exec_1.execShell)(VSCodeCommand, [projectPath, MAIN_TS_PATH], verbose);
|
|
27
27
|
}
|
|
28
28
|
//# sourceMappingURL=promptVSCode.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promptVSCode.js","sourceRoot":"","sources":["../../../../src/commands/init/promptVSCode.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,+CAA0C;AAC1C,
|
|
1
|
+
{"version":3,"file":"promptVSCode.js","sourceRoot":"","sources":["../../../../src/commands/init/promptVSCode.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,+CAA0C;AAC1C,qCAAuC;AACvC,yCAA6C;AAEtC,KAAK,UAAU,YAAY,CAChC,WAAmB,EACnB,aAAqB,EACrB,MAAe,EACf,OAAgB;IAEhB,IAAI,MAAM,EAAE;QACV,kDAAkD;QAClD,yCAAyC;QACzC,UAAU,CAAC,WAAW,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC;QAChD,OAAO;KACR;IAED,MAAM,gBAAgB,GAAG,MAAM,IAAA,sBAAa,EAC1C,qDAAqD,CACtD,CAAC;IACF,IAAI,gBAAgB,EAAE;QACpB,UAAU,CAAC,WAAW,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC;KACjD;AACH,CAAC;AAnBD,oCAmBC;AAED,SAAS,UAAU,CACjB,WAAmB,EACnB,aAAqB,EACrB,OAAgB;IAEhB,MAAM,YAAY,GAAG,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,mBAAO,CAAC,CAAC;IAC5D,IAAA,gBAAS,EAAC,aAAa,EAAE,CAAC,WAAW,EAAE,YAAY,CAAC,EAAE,OAAO,CAAC,CAAC;AACjE,CAAC"}
|
|
@@ -26,7 +26,7 @@ exports.copyWatcherMod = void 0;
|
|
|
26
26
|
const path_1 = __importDefault(require("path"));
|
|
27
27
|
const constants_1 = require("../../constants");
|
|
28
28
|
const file = __importStar(require("../../file"));
|
|
29
|
-
function copyWatcherMod(config) {
|
|
29
|
+
function copyWatcherMod(config, verbose) {
|
|
30
30
|
// Check to see if this mod was disabled
|
|
31
31
|
const watcherModPath = path_1.default.join(config.modsDirectory, constants_1.WATCHER_MOD_NAME);
|
|
32
32
|
const disableItPath = path_1.default.join(watcherModPath, constants_1.DISABLE_IT_FILE);
|
|
@@ -34,18 +34,18 @@ function copyWatcherMod(config) {
|
|
|
34
34
|
// Delete and re-copy the watcher mod every time IsaacScript starts
|
|
35
35
|
// This ensures that it is always the latest version
|
|
36
36
|
if (file.exists(watcherModPath)) {
|
|
37
|
-
file.deleteFileOrDirectory(watcherModPath);
|
|
37
|
+
file.deleteFileOrDirectory(watcherModPath, verbose);
|
|
38
38
|
}
|
|
39
|
-
file.copy(constants_1.WATCHER_MOD_SOURCE_PATH, watcherModPath);
|
|
39
|
+
file.copy(constants_1.WATCHER_MOD_SOURCE_PATH, watcherModPath, verbose);
|
|
40
40
|
if (watcherModDisabled) {
|
|
41
41
|
// Since we deleted the directory, the "disable.it" file was deleted
|
|
42
42
|
// Restore it
|
|
43
|
-
file.write(disableItPath, "");
|
|
43
|
+
file.write(disableItPath, "", verbose);
|
|
44
44
|
}
|
|
45
45
|
// By default, the IsaacScript watcher mod automatically restarts the game,
|
|
46
46
|
// so we only need to disable it if the config option is explicitly set to false
|
|
47
47
|
if (config.enableIsaacScriptWatcherAutoRestart === false) {
|
|
48
|
-
disableIsaacScriptWatcherAutomaticRestart(watcherModPath);
|
|
48
|
+
disableIsaacScriptWatcherAutomaticRestart(watcherModPath, verbose);
|
|
49
49
|
}
|
|
50
50
|
// If we copied a new version of the watcher mod into place,
|
|
51
51
|
// but the user currently has the game open, then the old version will stay loaded
|
|
@@ -53,10 +53,10 @@ function copyWatcherMod(config) {
|
|
|
53
53
|
// so there is no automated solution for this
|
|
54
54
|
}
|
|
55
55
|
exports.copyWatcherMod = copyWatcherMod;
|
|
56
|
-
function disableIsaacScriptWatcherAutomaticRestart(watcherModPath) {
|
|
56
|
+
function disableIsaacScriptWatcherAutomaticRestart(watcherModPath, verbose) {
|
|
57
57
|
const mainLuaPath = path_1.default.join(watcherModPath, constants_1.MAIN_LUA);
|
|
58
58
|
const mainLua = file.read(mainLuaPath);
|
|
59
59
|
const modifiedMainLua = mainLua.replace("local RESTART_GAME_ON_RECOMPILATION = true", "local RESTART_GAME_ON_RECOMPILATION = false");
|
|
60
|
-
file.write(mainLuaPath, modifiedMainLua);
|
|
60
|
+
file.write(mainLuaPath, modifiedMainLua, verbose);
|
|
61
61
|
}
|
|
62
62
|
//# sourceMappingURL=copyWatcherMod.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copyWatcherMod.js","sourceRoot":"","sources":["../../../../src/commands/monitor/copyWatcherMod.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAwB;AACxB,+CAKyB;AACzB,iDAAmC;AAGnC,SAAgB,cAAc,CAAC,MAAc;
|
|
1
|
+
{"version":3,"file":"copyWatcherMod.js","sourceRoot":"","sources":["../../../../src/commands/monitor/copyWatcherMod.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAwB;AACxB,+CAKyB;AACzB,iDAAmC;AAGnC,SAAgB,cAAc,CAAC,MAAc,EAAE,OAAgB;IAC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= (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
|
-
const path_1 = __importDefault(require("path"));
|
|
7
6
|
const sync_directory_1 = __importDefault(require("sync-directory"));
|
|
8
7
|
const constants_1 = require("../../../constants");
|
|
9
|
-
const monkeyPatch_1 = require("../../../monkeyPatch");
|
|
10
8
|
let modSourcePath;
|
|
11
9
|
let modTargetPath;
|
|
12
10
|
init();
|
|
@@ -33,9 +31,11 @@ function afterEachSync(params) {
|
|
|
33
31
|
if (params === undefined) {
|
|
34
32
|
return;
|
|
35
33
|
}
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
/*
|
|
35
|
+
if (params.relativePath === path.sep + MAIN_LUA) {
|
|
36
|
+
monkeyPatchMainLua(modTargetPath);
|
|
38
37
|
}
|
|
38
|
+
*/
|
|
39
39
|
if (params.eventType !== "init:copy") {
|
|
40
40
|
send(`${constants_1.FILE_SYNCED_MESSAGE} ${params.relativePath}`);
|
|
41
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modDirectorySyncer.js","sourceRoot":"","sources":["../../../../../src/commands/monitor/modDirectorySyncer/modDirectorySyncer.ts"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"modDirectorySyncer.js","sourceRoot":"","sources":["../../../../../src/commands/monitor/modDirectorySyncer/modDirectorySyncer.ts"],"names":[],"mappings":";;;;;AAAA,oEAA2C;AAC3C,kDAAyD;AAEzD,IAAI,aAAqB,CAAC;AAC1B,IAAI,aAAqB,CAAC;AAE1B,IAAI,EAAE,CAAC;AAEP,SAAS,IAAI;IACX,MAAM,OAAO,GAAG,CAAC,CAAC;IAClB,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,GAAG,OAAO,EAAE;QACvC,MAAM,IAAI,KAAK,CACb,yEAAyE,CAC1E,CAAC;KACH;IAED,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAChC,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAEhC,IAAA,wBAAa,EAAC,aAAa,EAAE,aAAa,EAAE;QAC1C,KAAK,EAAE,IAAI;QACX,IAAI,EAAE,MAAM;QACZ,aAAa;QACb,OAAO;QACP,oBAAoB,EAAE;YACpB,gBAAgB,EAAE;gBAChB,kBAAkB,EAAE,IAAI;aACzB;SACF;KACF,CAAC,CAAC;AACL,CAAC;AAED,SAAS,aAAa,CAAC,MAMtB;IACC,IAAI,MAAM,KAAK,SAAS,EAAE;QACxB,OAAO;KACR;IAED;;;;MAIE;IAEF,IAAI,MAAM,CAAC,SAAS,KAAK,WAAW,EAAE;QACpC,IAAI,CAAC,GAAG,+BAAmB,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;KACvD;AACH,CAAC;AAED,SAAS,OAAO,CAAC,GAAU;IACzB,OAAO,CAAC,KAAK,CAAC,4CAA4C,EAAE,GAAG,CAAC,CAAC;AACnE,CAAC;AAED,SAAS,IAAI,CAAC,GAAW;IACvB,IAAI,OAAO,OAAO,CAAC,IAAI,KAAK,UAAU,EAAE;QACtC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACnB;AACH,CAAC"}
|
|
@@ -35,6 +35,7 @@ const notifyGame = __importStar(require("./notifyGame"));
|
|
|
35
35
|
const spawnSaveDatWriter_1 = require("./spawnSaveDatWriter");
|
|
36
36
|
const touchWatcherSaveDatFiles_1 = require("./touchWatcherSaveDatFiles");
|
|
37
37
|
function monitor(argv, config) {
|
|
38
|
+
const verbose = argv.verbose === true;
|
|
38
39
|
// If they specified some command-line flags, override the values found in the config file
|
|
39
40
|
if (argv.modsDirectory !== undefined) {
|
|
40
41
|
config.modsDirectory = argv.modsDirectory; // eslint-disable-line no-param-reassign
|
|
@@ -48,12 +49,12 @@ function monitor(argv, config) {
|
|
|
48
49
|
const modTargetDirectoryName = (0, util_1.getModTargetDirectoryName)(config);
|
|
49
50
|
const modTargetPath = path_1.default.join(config.modsDirectory, modTargetDirectoryName);
|
|
50
51
|
// Prepare the IsaacScript watcher mod
|
|
51
|
-
(0, copyWatcherMod_1.copyWatcherMod)(config);
|
|
52
|
-
(0, touchWatcherSaveDatFiles_1.touchWatcherSaveDatFiles)(config);
|
|
52
|
+
(0, copyWatcherMod_1.copyWatcherMod)(config, verbose);
|
|
53
|
+
(0, touchWatcherSaveDatFiles_1.touchWatcherSaveDatFiles)(config, verbose);
|
|
53
54
|
// Delete and re-copy the mod every time IsaacScript starts
|
|
54
55
|
// This ensures that it is always the latest version
|
|
55
56
|
if (file.exists(modTargetPath)) {
|
|
56
|
-
file.deleteFileOrDirectory(modTargetPath);
|
|
57
|
+
file.deleteFileOrDirectory(modTargetPath, true);
|
|
57
58
|
}
|
|
58
59
|
// Subprocess #1 - The "save#.dat" file writer
|
|
59
60
|
(0, spawnSaveDatWriter_1.spawnSaveDatWriter)(config);
|