isaacscript 2.0.11 → 2.0.12-alpha.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/README.md +8 -4
- package/package.json +8 -53
- package/src/checkForWindowsTerminalBugs.d.ts +5 -0
- package/src/checkForWindowsTerminalBugs.js +80 -0
- package/src/checkForWindowsTerminalBugs.js.map +1 -0
- package/src/commands/copy/copy.d.ts +3 -0
- package/src/commands/copy/copy.js +33 -0
- package/src/commands/copy/copy.js.map +1 -0
- package/src/commands/init/checkIfProjectPathExists.d.ts +1 -0
- package/src/commands/init/checkIfProjectPathExists.js +30 -0
- package/src/commands/init/checkIfProjectPathExists.js.map +1 -0
- package/src/commands/init/checkModSubdirectory.d.ts +1 -0
- package/src/commands/init/checkModSubdirectory.js +16 -0
- package/src/commands/init/checkModSubdirectory.js.map +1 -0
- package/src/commands/init/checkModTargetDirectory.d.ts +1 -0
- package/src/commands/init/checkModTargetDirectory.js +33 -0
- package/src/commands/init/checkModTargetDirectory.js.map +1 -0
- package/src/commands/init/createMod.d.ts +1 -0
- package/{dist/src → src}/commands/init/createMod.js +137 -162
- package/src/commands/init/createMod.js.map +1 -0
- package/src/commands/init/getModsDir.d.ts +1 -0
- package/src/commands/init/getModsDir.js +58 -0
- package/src/commands/init/getModsDir.js.map +1 -0
- package/src/commands/init/getProjectPath.d.ts +1 -0
- package/src/commands/init/getProjectPath.js +93 -0
- package/src/commands/init/getProjectPath.js.map +1 -0
- package/src/commands/init/git.d.ts +4 -0
- package/{dist/src → src}/commands/init/git.js +152 -175
- package/src/commands/init/git.js.map +1 -0
- package/src/commands/init/init.d.ts +1 -0
- package/src/commands/init/init.js +70 -0
- package/src/commands/init/init.js.map +1 -0
- package/src/commands/init/installVSCodeExtensions.d.ts +1 -0
- package/src/commands/init/installVSCodeExtensions.js +33 -0
- package/src/commands/init/installVSCodeExtensions.js.map +1 -0
- package/src/commands/init/promptSaveSlot.d.ts +1 -0
- package/src/commands/init/promptSaveSlot.js +25 -0
- package/src/commands/init/promptSaveSlot.js.map +1 -0
- package/src/commands/init/promptVSCode.d.ts +1 -0
- package/src/commands/init/promptVSCode.js +27 -0
- package/src/commands/init/promptVSCode.js.map +1 -0
- package/src/commands/monitor/constants.d.ts +1 -0
- package/{dist/src → src}/commands/monitor/constants.js +4 -4
- package/src/commands/monitor/constants.js.map +1 -0
- package/src/commands/monitor/copyWatcherMod.d.ts +2 -0
- package/{dist/src → src}/commands/monitor/copyWatcherMod.js +38 -63
- package/src/commands/monitor/copyWatcherMod.js.map +1 -0
- package/src/commands/monitor/modDirectorySyncer/modDirectorySyncer.d.ts +1 -0
- package/{dist/src → src}/commands/monitor/modDirectorySyncer/modDirectorySyncer.js +49 -51
- package/src/commands/monitor/modDirectorySyncer/modDirectorySyncer.js.map +1 -0
- package/src/commands/monitor/monitor.d.ts +2 -0
- package/{dist/src → src}/commands/monitor/monitor.js +146 -171
- package/src/commands/monitor/monitor.js.map +1 -0
- package/src/commands/monitor/notifyGame.d.ts +3 -0
- package/{dist/src → src}/commands/monitor/notifyGame.js +57 -59
- package/src/commands/monitor/notifyGame.js.map +1 -0
- package/src/commands/monitor/saveDatWriter/saveDatWriter.d.ts +1 -0
- package/{dist/src → src}/commands/monitor/saveDatWriter/saveDatWriter.js +116 -141
- package/src/commands/monitor/saveDatWriter/saveDatWriter.js.map +1 -0
- package/src/commands/monitor/saveDatWriter/types.d.ts +5 -0
- package/{dist/src → src}/commands/monitor/saveDatWriter/types.js +2 -2
- package/src/commands/monitor/saveDatWriter/types.js.map +1 -0
- package/src/commands/monitor/spawnSaveDatWriter.d.ts +4 -0
- package/{dist/src → src}/commands/monitor/spawnSaveDatWriter.js +34 -36
- package/src/commands/monitor/spawnSaveDatWriter.js.map +1 -0
- package/src/commands/monitor/touchWatcherSaveDatFiles.d.ts +2 -0
- package/src/commands/monitor/touchWatcherSaveDatFiles.js +21 -0
- package/src/commands/monitor/touchWatcherSaveDatFiles.js.map +1 -0
- package/src/commands/publish/publish.d.ts +2 -0
- package/{dist/src → src}/commands/publish/publish.js +235 -260
- package/src/commands/publish/publish.js.map +1 -0
- package/src/configFile.d.ts +4 -0
- package/src/configFile.js +66 -0
- package/src/configFile.js.map +1 -0
- package/src/constants.d.ts +34 -0
- package/{dist/src → src}/constants.js +59 -61
- package/src/constants.js.map +1 -0
- package/src/exec.d.ts +4 -0
- package/{dist/src → src}/exec.js +95 -97
- package/src/exec.js.map +1 -0
- package/src/file.d.ts +12 -0
- package/{dist/src → src}/file.js +193 -195
- package/src/file.js.map +1 -0
- package/src/main.d.ts +2 -0
- package/src/main.js +115 -0
- package/src/main.js.map +1 -0
- package/src/parseArgs.d.ts +1 -0
- package/{dist/src → src}/parseArgs.js +106 -108
- package/src/parseArgs.js.map +1 -0
- package/src/prompt.d.ts +5 -0
- package/src/prompt.js +93 -0
- package/src/prompt.js.map +1 -0
- package/src/types/Command.d.ts +2 -0
- package/{dist/src → src}/types/Command.js +4 -4
- package/src/types/Command.js.map +1 -0
- package/src/types/Config.d.ts +18 -0
- package/{dist/src → src}/types/Config.js +12 -12
- package/src/types/Config.js.map +1 -0
- package/src/types/GitHubCLIHostsYAML.d.ts +7 -0
- package/{dist/src → src}/types/GitHubCLIHostsYAML.js +2 -2
- package/src/types/GitHubCLIHostsYAML.js.map +1 -0
- package/src/utils.d.ts +13 -0
- package/{dist/src → src}/utils.js +81 -83
- package/src/utils.js.map +1 -0
- package/src/validateInIsaacScriptProject.d.ts +1 -0
- package/src/validateInIsaacScriptProject.js +27 -0
- package/src/validateInIsaacScriptProject.js.map +1 -0
- package/src/validateNodeVersion.d.ts +5 -0
- package/{dist/src → src}/validateNodeVersion.js +24 -26
- package/src/validateNodeVersion.js.map +1 -0
- package/src/validateOS.d.ts +1 -0
- package/{dist/src → src}/validateOS.js +16 -18
- package/src/validateOS.js.map +1 -0
- package/LICENSE +0 -674
- package/dist/package.json +0 -57
- package/dist/src/checkForWindowsTerminalBugs.js +0 -101
- package/dist/src/commands/copy/copy.js +0 -58
- package/dist/src/commands/init/checkIfProjectPathExists.js +0 -53
- package/dist/src/commands/init/checkModSubdirectory.js +0 -41
- package/dist/src/commands/init/checkModTargetDirectory.js +0 -56
- package/dist/src/commands/init/getModsDir.js +0 -81
- package/dist/src/commands/init/getProjectPath.js +0 -91
- package/dist/src/commands/init/init.js +0 -68
- package/dist/src/commands/init/installVSCodeExtensions.js +0 -58
- package/dist/src/commands/init/promptSaveSlot.js +0 -22
- package/dist/src/commands/init/promptVSCode.js +0 -27
- package/dist/src/commands/monitor/touchWatcherSaveDatFiles.js +0 -46
- package/dist/src/configFile.js +0 -89
- package/dist/src/main.js +0 -136
- package/dist/src/prompt.js +0 -89
- package/dist/src/validateInIsaacScriptProject.js +0 -52
- package/isaacscript-watcher/.luacheckrc +0 -96
- package/isaacscript-watcher/README.md +0 -8
- package/isaacscript-watcher/main.lua +0 -270
- package/isaacscript-watcher/metadata.xml +0 -7
- package/isaacscript-watcher/resources/gfx/logo.anm2 +0 -27
- package/isaacscript-watcher/resources/gfx/logo.png +0 -0
package/README.md
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
#
|
|
1
|
+
# isaacscript-cli
|
|
2
2
|
|
|
3
|
-
[
|
|
3
|
+
This library was generated with [Nx](https://nx.dev).
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Building
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Run `nx build isaacscript-cli` to build the library.
|
|
8
|
+
|
|
9
|
+
## Running unit tests
|
|
10
|
+
|
|
11
|
+
Run `nx test isaacscript-cli` to execute the unit tests via [Jest](https://jestjs.io).
|
package/package.json
CHANGED
|
@@ -1,57 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript",
|
|
3
|
-
"version": "2.0.
|
|
4
|
-
"
|
|
5
|
-
"homepage": "https://isaacscript.github.io/",
|
|
6
|
-
"bugs": {
|
|
7
|
-
"url": "https://github.com/IsaacScript/isaacscript/issues"
|
|
8
|
-
},
|
|
9
|
-
"repository": {
|
|
10
|
-
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/IsaacScript/isaacscript.git"
|
|
12
|
-
},
|
|
3
|
+
"version": "2.0.12-alpha.4",
|
|
4
|
+
"type": "commonjs",
|
|
13
5
|
"license": "GPL-3.0",
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"dist/**/*.js",
|
|
20
|
-
"dist/**/*.d.ts",
|
|
21
|
-
"dist/**/*.json",
|
|
22
|
-
"isaacscript-watcher/**"
|
|
23
|
-
],
|
|
24
|
-
"dependencies": {
|
|
25
|
-
"@types/node": "^17.0.35",
|
|
26
|
-
"chalk": "4.1.2",
|
|
27
|
-
"command-exists": "^1.2.9",
|
|
28
|
-
"dotenv": "^16.0.1",
|
|
29
|
-
"figlet": "^1.5.2",
|
|
30
|
-
"fs-extra": "^10.1.0",
|
|
31
|
-
"isaacscript-tsconfig": "^1.1.16",
|
|
32
|
-
"jsonc-parser": "^3.0.0",
|
|
33
|
-
"moment": "^2.29.3",
|
|
34
|
-
"npm-check-updates": "^13.0.1",
|
|
35
|
-
"prompt": "^1.3.0",
|
|
36
|
-
"source-map": "^0.7.3",
|
|
37
|
-
"source-map-support": "^0.5.21",
|
|
38
|
-
"sync-directory": "^5.0.8",
|
|
39
|
-
"ts-node": "^10.7.0",
|
|
40
|
-
"typescript": "^4.6.4",
|
|
41
|
-
"typescript-to-lua": "^1.4.4",
|
|
42
|
-
"update-notifier": "^5.1.0",
|
|
43
|
-
"yaml": "^2.1.0",
|
|
44
|
-
"yargs": "^17.5.1"
|
|
45
|
-
},
|
|
46
|
-
"devDependencies": {
|
|
47
|
-
"@types/command-exists": "^1.2.0",
|
|
48
|
-
"@types/figlet": "^1.5.4",
|
|
49
|
-
"@types/fs-extra": "^9.0.13",
|
|
50
|
-
"@types/prompt": "^1.1.2",
|
|
51
|
-
"@types/source-map-support": "^0.5.4",
|
|
52
|
-
"@types/update-notifier": "^5.1.0",
|
|
53
|
-
"@types/yargs": "^17.0.10",
|
|
54
|
-
"isaacscript-lint": "^1.0.159",
|
|
55
|
-
"isaacscript-spell": "^1.0.3"
|
|
6
|
+
"main": "./src/index.js",
|
|
7
|
+
"typings": "./src/index.d.ts",
|
|
8
|
+
"dependencies": {},
|
|
9
|
+
"peerDependencies": {
|
|
10
|
+
"tslib": "^2.3.0"
|
|
56
11
|
}
|
|
57
|
-
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkForWindowsTerminalBugs = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
7
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
8
|
+
const constants_1 = require("./constants");
|
|
9
|
+
const file = tslib_1.__importStar(require("./file"));
|
|
10
|
+
const prompt_1 = require("./prompt");
|
|
11
|
+
const utils_1 = require("./utils");
|
|
12
|
+
const BASH_PROFILE_PATH = path_1.default.join(constants_1.HOME_DIR, ".bash_profile");
|
|
13
|
+
/**
|
|
14
|
+
* By default, Git Bash for Windows uses MINGW64. This will not work correctly with the prompt
|
|
15
|
+
* library. Try to detect this and warn the end-user.
|
|
16
|
+
*/
|
|
17
|
+
function checkForWindowsTerminalBugs(verbose) {
|
|
18
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
if (process.platform !== "win32") {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (process.env["SHELL"] !== "C:\\Program Files\\Git\\usr\\bin\\bash.exe") {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
yield checkForWindowsBugColor(verbose);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
exports.checkForWindowsTerminalBugs = checkForWindowsTerminalBugs;
|
|
29
|
+
function checkForWindowsBugColor(verbose) {
|
|
30
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
if (process.env["FORCE_COLOR"] === "true") {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
console.error(chalk_1.default.red(`Error: It looks like you are using Git Bash for Windows (MINGW64) without the "${chalk_1.default.green("FORCE_COLOR")}" environment variable.`));
|
|
35
|
+
console.error("This is necessary in order for colors to work properly in the terminal.");
|
|
36
|
+
const shouldFixColors = yield (0, prompt_1.getInputYesNo)("Do you want me to fix this for you?");
|
|
37
|
+
if (!shouldFixColors) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
applyFixesToBashProfile(verbose);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function applyFixesToBashProfile(verbose) {
|
|
44
|
+
// Check to see if the Bash profile has data.
|
|
45
|
+
let bashProfileContents;
|
|
46
|
+
if (file.exists(BASH_PROFILE_PATH, verbose)) {
|
|
47
|
+
bashProfileContents = file.read(BASH_PROFILE_PATH, verbose);
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
bashProfileContents = "";
|
|
51
|
+
}
|
|
52
|
+
const appendText = getBashProfileAppendText(bashProfileContents);
|
|
53
|
+
try {
|
|
54
|
+
fs_1.default.appendFileSync(BASH_PROFILE_PATH, appendText);
|
|
55
|
+
}
|
|
56
|
+
catch (err) {
|
|
57
|
+
(0, utils_1.error)(`Failed to append text to "${BASH_PROFILE_PATH}":`, err);
|
|
58
|
+
}
|
|
59
|
+
console.log(chalk_1.default.green("Complete!"), `The terminal fixes have been added to: ${chalk_1.default.green(BASH_PROFILE_PATH)}`);
|
|
60
|
+
console.log(chalk_1.default.red("Please close and re-open your terminal, then run this program again."));
|
|
61
|
+
process.exit(0);
|
|
62
|
+
}
|
|
63
|
+
function getBashProfileAppendText(bashProfileContents) {
|
|
64
|
+
let newText = "";
|
|
65
|
+
if (bashProfileContents !== "" &&
|
|
66
|
+
bashProfileContents[bashProfileContents.length - 1] !== "\n") {
|
|
67
|
+
// If the Bash profile exists and has data, it should end in a newline. Add an extra newline if
|
|
68
|
+
// this is not the case.
|
|
69
|
+
newText += "\n";
|
|
70
|
+
}
|
|
71
|
+
if (bashProfileContents !== "") {
|
|
72
|
+
// If the Bash profile exists and has data, add an extra newline between the existing stuff and
|
|
73
|
+
// the new lines added by us.
|
|
74
|
+
newText += "\n";
|
|
75
|
+
}
|
|
76
|
+
newText += `# Terminal fixes added by ${constants_1.PROJECT_NAME}\n`;
|
|
77
|
+
newText += "export FORCE_COLOR=true\n";
|
|
78
|
+
return newText;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=checkForWindowsTerminalBugs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkForWindowsTerminalBugs.js","sourceRoot":"","sources":["../../../../packages/isaacscript-cli/src/checkForWindowsTerminalBugs.ts"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAC1B,oDAAoB;AACpB,wDAAwB;AACxB,2CAAqD;AACrD,qDAA+B;AAC/B,qCAAyC;AACzC,mCAAgC;AAEhC,MAAM,iBAAiB,GAAG,cAAI,CAAC,IAAI,CAAC,oBAAQ,EAAE,eAAe,CAAC,CAAC;AAE/D;;;GAGG;AACH,SAAsB,2BAA2B,CAC/C,OAAgB;;QAEhB,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE;YAChC,OAAO;SACR;QAED,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,4CAA4C,EAAE;YACzE,OAAO;SACR;QAED,MAAM,uBAAuB,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;CAAA;AAZD,kEAYC;AAED,SAAe,uBAAuB,CAAC,OAAgB;;QACrD,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,KAAK,MAAM,EAAE;YACzC,OAAO;SACR;QAED,OAAO,CAAC,KAAK,CACX,eAAK,CAAC,GAAG,CACP,kFAAkF,eAAK,CAAC,KAAK,CAC3F,aAAa,CACd,yBAAyB,CAC3B,CACF,CAAC;QACF,OAAO,CAAC,KAAK,CACX,yEAAyE,CAC1E,CAAC;QAEF,MAAM,eAAe,GAAG,MAAM,IAAA,sBAAa,EACzC,qCAAqC,CACtC,CAAC;QACF,IAAI,CAAC,eAAe,EAAE;YACpB,OAAO;SACR;QAED,uBAAuB,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;CAAA;AAED,SAAS,uBAAuB,CAAC,OAAgB;IAC/C,6CAA6C;IAC7C,IAAI,mBAA2B,CAAC;IAChC,IAAI,IAAI,CAAC,MAAM,CAAC,iBAAiB,EAAE,OAAO,CAAC,EAAE;QAC3C,mBAAmB,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;KAC7D;SAAM;QACL,mBAAmB,GAAG,EAAE,CAAC;KAC1B;IAED,MAAM,UAAU,GAAG,wBAAwB,CAAC,mBAAmB,CAAC,CAAC;IAEjE,IAAI;QACF,YAAE,CAAC,cAAc,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC;KAClD;IAAC,OAAO,GAAG,EAAE;QACZ,IAAA,aAAK,EAAC,6BAA6B,iBAAiB,IAAI,EAAE,GAAG,CAAC,CAAC;KAChE;IAED,OAAO,CAAC,GAAG,CACT,eAAK,CAAC,KAAK,CAAC,WAAW,CAAC,EACxB,0CAA0C,eAAK,CAAC,KAAK,CAAC,iBAAiB,CAAC,EAAE,CAC3E,CAAC;IACF,OAAO,CAAC,GAAG,CACT,eAAK,CAAC,GAAG,CACP,sEAAsE,CACvE,CACF,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,SAAS,wBAAwB,CAAC,mBAA2B;IAC3D,IAAI,OAAO,GAAG,EAAE,CAAC;IAEjB,IACE,mBAAmB,KAAK,EAAE;QAC1B,mBAAmB,CAAC,mBAAmB,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,IAAI,EAC5D;QACA,+FAA+F;QAC/F,wBAAwB;QACxB,OAAO,IAAI,IAAI,CAAC;KACjB;IAED,IAAI,mBAAmB,KAAK,EAAE,EAAE;QAC9B,+FAA+F;QAC/F,6BAA6B;QAC7B,OAAO,IAAI,IAAI,CAAC;KACjB;IAED,OAAO,IAAI,6BAA6B,wBAAY,IAAI,CAAC;IACzD,OAAO,IAAI,2BAA2B,CAAC;IAEvC,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.compileAndCopy = exports.copy = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
6
|
+
const constants_1 = require("../../constants");
|
|
7
|
+
const exec_1 = require("../../exec");
|
|
8
|
+
const file = tslib_1.__importStar(require("../../file"));
|
|
9
|
+
const utils_1 = require("../../utils");
|
|
10
|
+
function copy(argv, config) {
|
|
11
|
+
const verbose = argv["verbose"] === true;
|
|
12
|
+
const modTargetDirectoryName = (0, utils_1.getModTargetDirectoryName)(config);
|
|
13
|
+
const modTargetPath = path_1.default.join(config.modsDirectory, modTargetDirectoryName);
|
|
14
|
+
compileAndCopy(constants_1.MOD_SOURCE_PATH, modTargetPath, verbose);
|
|
15
|
+
}
|
|
16
|
+
exports.copy = copy;
|
|
17
|
+
function compileAndCopy(modSourcePath, modTargetPath, verbose) {
|
|
18
|
+
compile(verbose);
|
|
19
|
+
copyMod(modSourcePath, modTargetPath, verbose);
|
|
20
|
+
}
|
|
21
|
+
exports.compileAndCopy = compileAndCopy;
|
|
22
|
+
function compile(verbose) {
|
|
23
|
+
(0, exec_1.execShell)("npx", ["tstl"], verbose);
|
|
24
|
+
console.log("Mod compiled successfully.");
|
|
25
|
+
}
|
|
26
|
+
function copyMod(modSourcePath, modTargetPath, verbose) {
|
|
27
|
+
if (file.exists(modTargetPath, verbose)) {
|
|
28
|
+
file.deleteFileOrDirectory(modTargetPath, verbose);
|
|
29
|
+
}
|
|
30
|
+
file.copy(modSourcePath, modTargetPath, verbose);
|
|
31
|
+
console.log("Mod copied successfully.");
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=copy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy.js","sourceRoot":"","sources":["../../../../../../packages/isaacscript-cli/src/commands/copy/copy.ts"],"names":[],"mappings":";;;;AAAA,wDAAwB;AACxB,+CAAkD;AAClD,qCAAuC;AACvC,yDAAmC;AAEnC,uCAAwD;AAExD,SAAgB,IAAI,CAAC,IAA6B,EAAE,MAAc;IAChE,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;IAEzC,MAAM,sBAAsB,GAAG,IAAA,iCAAyB,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,OAAO,CAAC,aAAa,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC;AACjD,CAAC;AAPD,wCAOC;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,EAAE,OAAO,CAAC,EAAE;QACvC,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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function checkIfProjectPathExists(projectPath: string, yes: boolean, verbose: boolean): Promise<void>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkIfProjectPathExists = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
|
+
const constants_1 = require("../../constants");
|
|
7
|
+
const file = tslib_1.__importStar(require("../../file"));
|
|
8
|
+
const prompt_1 = require("../../prompt");
|
|
9
|
+
const utils_1 = require("../../utils");
|
|
10
|
+
function checkIfProjectPathExists(projectPath, yes, verbose) {
|
|
11
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
12
|
+
if (projectPath === constants_1.CWD || !file.exists(projectPath, verbose)) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const fileType = file.isDir(projectPath, verbose) ? "directory" : "file";
|
|
16
|
+
if (yes) {
|
|
17
|
+
file.deleteFileOrDirectory(projectPath, verbose);
|
|
18
|
+
console.log(`Deleted ${fileType}: ${chalk_1.default.green(projectPath)}`);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
console.log(`A ${fileType} already exists with a name of: ${chalk_1.default.green(projectPath)}`);
|
|
22
|
+
const shouldDelete = yield (0, prompt_1.getInputYesNo)("Do you want me to delete it?");
|
|
23
|
+
if (!shouldDelete) {
|
|
24
|
+
(0, utils_1.error)("Ok then. Goodbye.");
|
|
25
|
+
}
|
|
26
|
+
file.deleteFileOrDirectory(projectPath, verbose);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
exports.checkIfProjectPathExists = checkIfProjectPathExists;
|
|
30
|
+
//# sourceMappingURL=checkIfProjectPathExists.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkIfProjectPathExists.js","sourceRoot":"","sources":["../../../../../../packages/isaacscript-cli/src/commands/init/checkIfProjectPathExists.ts"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAC1B,+CAAsC;AACtC,yDAAmC;AACnC,yCAA6C;AAC7C,uCAAoC;AAEpC,SAAsB,wBAAwB,CAC5C,WAAmB,EACnB,GAAY,EACZ,OAAgB;;QAEhB,IAAI,WAAW,KAAK,eAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,EAAE;YAC7D,OAAO;SACR;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC;QAEzE,IAAI,GAAG,EAAE;YACP,IAAI,CAAC,qBAAqB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;YACjD,OAAO,CAAC,GAAG,CAAC,WAAW,QAAQ,KAAK,eAAK,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;YAChE,OAAO;SACR;QAED,OAAO,CAAC,GAAG,CACT,KAAK,QAAQ,mCAAmC,eAAK,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,CAC3E,CAAC;QACF,MAAM,YAAY,GAAG,MAAM,IAAA,sBAAa,EAAC,8BAA8B,CAAC,CAAC;QAEzE,IAAI,CAAC,YAAY,EAAE;YACjB,IAAA,aAAK,EAAC,mBAAmB,CAAC,CAAC;SAC5B;QAED,IAAI,CAAC,qBAAqB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC;CAAA;AA3BD,4DA2BC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function checkModSubdirectory(projectPath: string, modsDirectory: string): void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkModSubdirectory = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
|
+
const constants_1 = require("../../constants");
|
|
7
|
+
const file = tslib_1.__importStar(require("../../file"));
|
|
8
|
+
const utils_1 = require("../../utils");
|
|
9
|
+
function checkModSubdirectory(projectPath, modsDirectory) {
|
|
10
|
+
if (file.isSubDirOf(constants_1.CWD, modsDirectory)) {
|
|
11
|
+
console.error(`Error: The project directory of "${chalk_1.default.green(projectPath)}" is a subdirectory of "${chalk_1.default.green(modsDirectory)}".`);
|
|
12
|
+
(0, utils_1.error)('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.');
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.checkModSubdirectory = checkModSubdirectory;
|
|
16
|
+
//# sourceMappingURL=checkModSubdirectory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkModSubdirectory.js","sourceRoot":"","sources":["../../../../../../packages/isaacscript-cli/src/commands/init/checkModSubdirectory.ts"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAC1B,+CAAsC;AACtC,yDAAmC;AACnC,uCAAoC;AAEpC,SAAgB,oBAAoB,CAClC,WAAmB,EACnB,aAAqB;IAErB,IAAI,IAAI,CAAC,UAAU,CAAC,eAAG,EAAE,aAAa,CAAC,EAAE;QACvC,OAAO,CAAC,KAAK,CACX,oCAAoC,eAAK,CAAC,KAAK,CAC7C,WAAW,CACZ,2BAA2B,eAAK,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAC3D,CAAC;QACF,IAAA,aAAK,EACH,+NAA+N,CAChO,CAAC;KACH;AACH,CAAC;AAdD,oDAcC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function checkModTargetDirectory(modsDirectory: string, projectName: string, yes: boolean, verbose: boolean): Promise<void>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkModTargetDirectory = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
7
|
+
const constants_1 = require("../../constants");
|
|
8
|
+
const file = tslib_1.__importStar(require("../../file"));
|
|
9
|
+
const prompt_1 = require("../../prompt");
|
|
10
|
+
const utils_1 = require("../../utils");
|
|
11
|
+
function checkModTargetDirectory(modsDirectory, projectName, yes, verbose) {
|
|
12
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
13
|
+
const modTargetPath = path_1.default.join(modsDirectory, projectName);
|
|
14
|
+
if (!file.exists(modTargetPath, verbose)) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const fileType = file.isDir(modTargetPath, verbose) ? "directory" : "file";
|
|
18
|
+
if (yes) {
|
|
19
|
+
file.deleteFileOrDirectory(modTargetPath, verbose);
|
|
20
|
+
console.log(`Deleted ${fileType}: ${chalk_1.default.green(modTargetPath)}`);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
console.log(`A ${fileType} already exists at at the mod path of: ${chalk_1.default.green(modTargetPath)}`);
|
|
24
|
+
console.log(`${constants_1.PROJECT_NAME} will need to sync your project folder with this directory.`);
|
|
25
|
+
const shouldDelete = yield (0, prompt_1.getInputYesNo)("Do you want me to delete it?");
|
|
26
|
+
if (!shouldDelete) {
|
|
27
|
+
(0, utils_1.error)("Ok then. Goodbye.");
|
|
28
|
+
}
|
|
29
|
+
file.deleteFileOrDirectory(modTargetPath, verbose);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
exports.checkModTargetDirectory = checkModTargetDirectory;
|
|
33
|
+
//# sourceMappingURL=checkModTargetDirectory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkModTargetDirectory.js","sourceRoot":"","sources":["../../../../../../packages/isaacscript-cli/src/commands/init/checkModTargetDirectory.ts"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAC1B,wDAAwB;AACxB,+CAA+C;AAC/C,yDAAmC;AACnC,yCAA6C;AAC7C,uCAAoC;AAEpC,SAAsB,uBAAuB,CAC3C,aAAqB,EACrB,WAAmB,EACnB,GAAY,EACZ,OAAgB;;QAEhB,MAAM,aAAa,GAAG,cAAI,CAAC,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;QAC5D,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,EAAE;YACxC,OAAO;SACR;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC;QAE3E,IAAI,GAAG,EAAE;YACP,IAAI,CAAC,qBAAqB,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;YACnD,OAAO,CAAC,GAAG,CAAC,WAAW,QAAQ,KAAK,eAAK,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;YAClE,OAAO;SACR;QAED,OAAO,CAAC,GAAG,CACT,KAAK,QAAQ,0CAA0C,eAAK,CAAC,KAAK,CAChE,aAAa,CACd,EAAE,CACJ,CAAC;QACF,OAAO,CAAC,GAAG,CACT,GAAG,wBAAY,6DAA6D,CAC7E,CAAC;QACF,MAAM,YAAY,GAAG,MAAM,IAAA,sBAAa,EAAC,8BAA8B,CAAC,CAAC;QAEzE,IAAI,CAAC,YAAY,EAAE;YACjB,IAAA,aAAK,EAAC,mBAAmB,CAAC,CAAC;SAC5B;QAED,IAAI,CAAC,qBAAqB,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC;CAAA;AAlCD,0DAkCC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createMod(projectName: string, projectPath: string, createNewDir: boolean, modsDirectory: string, saveSlot: number, gitRemoteURL: string | undefined, skipNPMInstall: boolean, verbose: boolean): void;
|