isaacscript 2.0.14-dev.6 → 2.0.14-dev.9

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.
Files changed (93) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +4 -6
  3. package/file-templates/static/{.eslintrc.js → .eslintrc.js.template} +0 -0
  4. package/file-templates/static/.github/workflows/ci.yml +4 -3
  5. package/package.json +5 -1
  6. package/src/checkForWindowsTerminalBugs.js +75 -79
  7. package/src/checkForWindowsTerminalBugs.js.map +1 -1
  8. package/src/commands/copy/copy.js +32 -32
  9. package/src/commands/init/checkIfProjectPathExists.js +27 -29
  10. package/src/commands/init/checkIfProjectPathExists.js.map +1 -1
  11. package/src/commands/init/checkModSubdirectory.js +15 -15
  12. package/src/commands/init/checkModTargetDirectory.js +30 -32
  13. package/src/commands/init/checkModTargetDirectory.js.map +1 -1
  14. package/src/commands/init/createMod.js +142 -137
  15. package/src/commands/init/createMod.js.map +1 -1
  16. package/src/commands/init/getModsDir.js +55 -57
  17. package/src/commands/init/getModsDir.js.map +1 -1
  18. package/src/commands/init/getProjectPath.js +88 -92
  19. package/src/commands/init/getProjectPath.js.map +1 -1
  20. package/src/commands/init/git.js +150 -152
  21. package/src/commands/init/git.js.map +1 -1
  22. package/src/commands/init/init.js +65 -69
  23. package/src/commands/init/init.js.map +1 -1
  24. package/src/commands/init/installVSCodeExtensions.js +32 -32
  25. package/src/commands/init/promptSaveSlot.js +21 -24
  26. package/src/commands/init/promptSaveSlot.js.map +1 -1
  27. package/src/commands/init/promptVSCode.js +24 -26
  28. package/src/commands/init/promptVSCode.js.map +1 -1
  29. package/src/commands/monitor/constants.js +4 -4
  30. package/src/commands/monitor/copyWatcherMod.js +38 -38
  31. package/src/commands/monitor/modDirectorySyncer/modDirectorySyncer.js +49 -49
  32. package/src/commands/monitor/monitor.js +146 -146
  33. package/src/commands/monitor/notifyGame.js +57 -57
  34. package/src/commands/monitor/saveDatWriter/saveDatWriter.js +116 -116
  35. package/src/commands/monitor/saveDatWriter/types.js +2 -2
  36. package/src/commands/monitor/spawnSaveDatWriter.js +34 -34
  37. package/src/commands/monitor/touchWatcherSaveDatFiles.js +20 -20
  38. package/src/commands/publish/publish.js +220 -220
  39. package/src/configFile.js +63 -65
  40. package/src/configFile.js.map +1 -1
  41. package/src/constants.js +59 -59
  42. package/src/constants.js.map +1 -1
  43. package/src/exec.js +95 -95
  44. package/src/file.js +193 -193
  45. package/src/main.js +117 -121
  46. package/src/main.js.map +1 -1
  47. package/src/parseArgs.js +106 -106
  48. package/src/prompt.js +86 -92
  49. package/src/prompt.js.map +1 -1
  50. package/src/types/Command.js +4 -4
  51. package/src/types/Config.js +12 -12
  52. package/src/types/GitHubCLIHostsYAML.js +2 -2
  53. package/src/utils.js +81 -81
  54. package/src/validateInIsaacScriptProject.js +26 -26
  55. package/src/validateNodeVersion.js +24 -24
  56. package/src/validateOS.js +16 -16
  57. package/src/checkForWindowsTerminalBugs.d.ts +0 -5
  58. package/src/commands/copy/copy.d.ts +0 -3
  59. package/src/commands/init/checkIfProjectPathExists.d.ts +0 -1
  60. package/src/commands/init/checkModSubdirectory.d.ts +0 -1
  61. package/src/commands/init/checkModTargetDirectory.d.ts +0 -1
  62. package/src/commands/init/createMod.d.ts +0 -1
  63. package/src/commands/init/getModsDir.d.ts +0 -1
  64. package/src/commands/init/getProjectPath.d.ts +0 -1
  65. package/src/commands/init/git.d.ts +0 -4
  66. package/src/commands/init/init.d.ts +0 -1
  67. package/src/commands/init/installVSCodeExtensions.d.ts +0 -1
  68. package/src/commands/init/promptSaveSlot.d.ts +0 -1
  69. package/src/commands/init/promptVSCode.d.ts +0 -1
  70. package/src/commands/monitor/constants.d.ts +0 -1
  71. package/src/commands/monitor/copyWatcherMod.d.ts +0 -2
  72. package/src/commands/monitor/modDirectorySyncer/modDirectorySyncer.d.ts +0 -1
  73. package/src/commands/monitor/monitor.d.ts +0 -2
  74. package/src/commands/monitor/notifyGame.d.ts +0 -3
  75. package/src/commands/monitor/saveDatWriter/saveDatWriter.d.ts +0 -1
  76. package/src/commands/monitor/saveDatWriter/types.d.ts +0 -5
  77. package/src/commands/monitor/spawnSaveDatWriter.d.ts +0 -4
  78. package/src/commands/monitor/touchWatcherSaveDatFiles.d.ts +0 -2
  79. package/src/commands/publish/publish.d.ts +0 -2
  80. package/src/configFile.d.ts +0 -4
  81. package/src/constants.d.ts +0 -34
  82. package/src/exec.d.ts +0 -4
  83. package/src/file.d.ts +0 -12
  84. package/src/main.d.ts +0 -2
  85. package/src/parseArgs.d.ts +0 -1
  86. package/src/prompt.d.ts +0 -5
  87. package/src/types/Command.d.ts +0 -2
  88. package/src/types/Config.d.ts +0 -18
  89. package/src/types/GitHubCLIHostsYAML.d.ts +0 -7
  90. package/src/utils.d.ts +0 -13
  91. package/src/validateInIsaacScriptProject.d.ts +0 -1
  92. package/src/validateNodeVersion.d.ts +0 -5
  93. package/src/validateOS.d.ts +0 -1
package/README.md CHANGED
@@ -1,11 +1,9 @@
1
1
  # isaacscript-cli
2
2
 
3
- This library was generated with [Nx](https://nx.dev).
3
+ [![npm version](https://img.shields.io/npm/v/isaacscript.svg)](https://www.npmjs.com/package/isaacscript)
4
4
 
5
- ## Building
5
+ IsaacScript is a tool to help you create _Binding of Isaac: Repentance_ mods using [TypeScript](https://www.typescriptlang.org/).
6
6
 
7
- Run `nx build isaacscript-cli` to build the library.
7
+ Please visit the [official website](https://isaacscript.github.io/) for more information.
8
8
 
9
- ## Running unit tests
10
-
11
- Run `nx test isaacscript-cli` to execute the unit tests via [Jest](https://jestjs.io).
9
+ This package contains the command-line tool that initializes new mods and monitors the current project.
@@ -7,16 +7,17 @@ jobs:
7
7
  runs-on: ubuntu-latest
8
8
  steps:
9
9
  - name: Checkout the repository
10
- uses: actions/checkout@v2
10
+ uses: actions/checkout@v3
11
11
 
12
12
  - name: Setup Node.js
13
- uses: actions/setup-node@v2
13
+ uses: actions/setup-node@v3
14
14
  with:
15
15
  # The default version is 14. The ESLint config requires Node 16 to work properly.
16
16
  node-version: "16"
17
+ cache: "npm"
17
18
 
18
19
  - name: Retrieve the cached "node_modules" directory (if present)
19
- uses: actions/cache@v2
20
+ uses: actions/cache@v3
20
21
  id: node-cache
21
22
  with:
22
23
  path: node_modules
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript",
3
- "version": "2.0.14-dev.6",
3
+ "version": "2.0.14-dev.9",
4
4
  "description": "A command line tool for managing Isaac mods written in TypeScript",
5
5
  "homepage": "https://isaacscript.github.io/",
6
6
  "bugs": {
@@ -17,7 +17,11 @@
17
17
  "isaacscript": "./src/main.js"
18
18
  },
19
19
  "dependencies": {
20
+ "isaacscript-tsconfig": "^1.1.16",
21
+ "npm-check-updates": "^13.0.1",
22
+ "ts-node": "^10.7.0",
20
23
  "typescript": "^4.6.2",
24
+ "typescript-to-lua": "^1.4.4",
21
25
  "chalk": "4.1.2",
22
26
  "command-exists": "^1.2.9",
23
27
  "yaml": "^2.1.0",
@@ -1,80 +1,76 @@
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
- }
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
+ async function checkForWindowsTerminalBugs(verbose) {
18
+ if (process.platform !== "win32") {
19
+ return;
20
+ }
21
+ if (process.env["SHELL"] !== "C:\\Program Files\\Git\\usr\\bin\\bash.exe") {
22
+ return;
23
+ }
24
+ await checkForWindowsBugColor(verbose);
25
+ }
26
+ exports.checkForWindowsTerminalBugs = checkForWindowsTerminalBugs;
27
+ async function checkForWindowsBugColor(verbose) {
28
+ if (process.env["FORCE_COLOR"] === "true") {
29
+ return;
30
+ }
31
+ 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.`));
32
+ console.error("This is necessary in order for colors to work properly in the terminal.");
33
+ const shouldFixColors = await (0, prompt_1.getInputYesNo)("Do you want me to fix this for you?");
34
+ if (!shouldFixColors) {
35
+ return;
36
+ }
37
+ applyFixesToBashProfile(verbose);
38
+ }
39
+ function applyFixesToBashProfile(verbose) {
40
+ // Check to see if the Bash profile has data.
41
+ let bashProfileContents;
42
+ if (file.exists(BASH_PROFILE_PATH, verbose)) {
43
+ bashProfileContents = file.read(BASH_PROFILE_PATH, verbose);
44
+ }
45
+ else {
46
+ bashProfileContents = "";
47
+ }
48
+ const appendText = getBashProfileAppendText(bashProfileContents);
49
+ try {
50
+ fs_1.default.appendFileSync(BASH_PROFILE_PATH, appendText);
51
+ }
52
+ catch (err) {
53
+ (0, utils_1.error)(`Failed to append text to "${BASH_PROFILE_PATH}":`, err);
54
+ }
55
+ console.log(chalk_1.default.green("Complete!"), `The terminal fixes have been added to: ${chalk_1.default.green(BASH_PROFILE_PATH)}`);
56
+ console.log(chalk_1.default.red("Please close and re-open your terminal, then run this program again."));
57
+ process.exit(0);
58
+ }
59
+ function getBashProfileAppendText(bashProfileContents) {
60
+ let newText = "";
61
+ if (bashProfileContents !== "" &&
62
+ bashProfileContents[bashProfileContents.length - 1] !== "\n") {
63
+ // If the Bash profile exists and has data, it should end in a newline. Add an extra newline if
64
+ // this is not the case.
65
+ newText += "\n";
66
+ }
67
+ if (bashProfileContents !== "") {
68
+ // If the Bash profile exists and has data, add an extra newline between the existing stuff and
69
+ // the new lines added by us.
70
+ newText += "\n";
71
+ }
72
+ newText += `# Terminal fixes added by ${constants_1.PROJECT_NAME}\n`;
73
+ newText += "export FORCE_COLOR=true\n";
74
+ return newText;
75
+ }
80
76
  //# sourceMappingURL=checkForWindowsTerminalBugs.js.map
@@ -1 +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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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"}
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;AACI,KAAK,UAAU,2BAA2B,CAC/C,OAAgB;IAEhB,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE;QAChC,OAAO;KACR;IAED,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,4CAA4C,EAAE;QACzE,OAAO;KACR;IAED,MAAM,uBAAuB,CAAC,OAAO,CAAC,CAAC;AACzC,CAAC;AAZD,kEAYC;AAED,KAAK,UAAU,uBAAuB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AwB,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"}
@@ -1,33 +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
- }
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
33
  //# sourceMappingURL=copy.js.map
@@ -1,30 +1,28 @@
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;
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
+ async function checkIfProjectPathExists(projectPath, yes, verbose) {
11
+ if (projectPath === constants_1.CWD || !file.exists(projectPath, verbose)) {
12
+ return;
13
+ }
14
+ const fileType = file.isDir(projectPath, verbose) ? "directory" : "file";
15
+ if (yes) {
16
+ file.deleteFileOrDirectory(projectPath, verbose);
17
+ console.log(`Deleted ${fileType}: ${chalk_1.default.green(projectPath)}`);
18
+ return;
19
+ }
20
+ console.log(`A ${fileType} already exists with a name of: ${chalk_1.default.green(projectPath)}`);
21
+ const shouldDelete = await (0, prompt_1.getInputYesNo)("Do you want me to delete it?");
22
+ if (!shouldDelete) {
23
+ (0, utils_1.error)("Ok then. Goodbye.");
24
+ }
25
+ file.deleteFileOrDirectory(projectPath, verbose);
26
+ }
27
+ exports.checkIfProjectPathExists = checkIfProjectPathExists;
30
28
  //# sourceMappingURL=checkIfProjectPathExists.js.map
@@ -1 +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"}
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;AAE7B,KAAK,UAAU,wBAAwB,CAC5C,WAAmB,EACnB,GAAY,EACZ,OAAgB;IAEhB,IAAI,WAAW,KAAK,eAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,EAAE;QAC7D,OAAO;KACR;IAED,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC;IAEzE,IAAI,GAAG,EAAE;QACP,IAAI,CAAC,qBAAqB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QACjD,OAAO,CAAC,GAAG,CAAC,WAAW,QAAQ,KAAK,eAAK,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;QAChE,OAAO;KACR;IAED,OAAO,CAAC,GAAG,CACT,KAAK,QAAQ,mCAAmC,eAAK,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,CAC3E,CAAC;IACF,MAAM,YAAY,GAAG,MAAM,IAAA,sBAAa,EAAC,8BAA8B,CAAC,CAAC;IAEzE,IAAI,CAAC,YAAY,EAAE;QACjB,IAAA,aAAK,EAAC,mBAAmB,CAAC,CAAC;KAC5B;IAED,IAAI,CAAC,qBAAqB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AACnD,CAAC;AA3BD,4DA2BC"}
@@ -1,16 +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;
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
16
  //# sourceMappingURL=checkModSubdirectory.js.map
@@ -1,33 +1,31 @@
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;
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
+ async function checkModTargetDirectory(modsDirectory, projectName, yes, verbose) {
12
+ const modTargetPath = path_1.default.join(modsDirectory, projectName);
13
+ if (!file.exists(modTargetPath, verbose)) {
14
+ return;
15
+ }
16
+ const fileType = file.isDir(modTargetPath, verbose) ? "directory" : "file";
17
+ if (yes) {
18
+ file.deleteFileOrDirectory(modTargetPath, verbose);
19
+ console.log(`Deleted ${fileType}: ${chalk_1.default.green(modTargetPath)}`);
20
+ return;
21
+ }
22
+ console.log(`A ${fileType} already exists at at the mod path of: ${chalk_1.default.green(modTargetPath)}`);
23
+ console.log(`${constants_1.PROJECT_NAME} will need to sync your project folder with this directory.`);
24
+ const shouldDelete = await (0, prompt_1.getInputYesNo)("Do you want me to delete it?");
25
+ if (!shouldDelete) {
26
+ (0, utils_1.error)("Ok then. Goodbye.");
27
+ }
28
+ file.deleteFileOrDirectory(modTargetPath, verbose);
29
+ }
30
+ exports.checkModTargetDirectory = checkModTargetDirectory;
33
31
  //# sourceMappingURL=checkModTargetDirectory.js.map
@@ -1 +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"}
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;AAE7B,KAAK,UAAU,uBAAuB,CAC3C,aAAqB,EACrB,WAAmB,EACnB,GAAY,EACZ,OAAgB;IAEhB,MAAM,aAAa,GAAG,cAAI,CAAC,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;IAC5D,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,EAAE;QACxC,OAAO;KACR;IAED,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC;IAE3E,IAAI,GAAG,EAAE;QACP,IAAI,CAAC,qBAAqB,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QACnD,OAAO,CAAC,GAAG,CAAC,WAAW,QAAQ,KAAK,eAAK,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;QAClE,OAAO;KACR;IAED,OAAO,CAAC,GAAG,CACT,KAAK,QAAQ,0CAA0C,eAAK,CAAC,KAAK,CAChE,aAAa,CACd,EAAE,CACJ,CAAC;IACF,OAAO,CAAC,GAAG,CACT,GAAG,wBAAY,6DAA6D,CAC7E,CAAC;IACF,MAAM,YAAY,GAAG,MAAM,IAAA,sBAAa,EAAC,8BAA8B,CAAC,CAAC;IAEzE,IAAI,CAAC,YAAY,EAAE;QACjB,IAAA,aAAK,EAAC,mBAAmB,CAAC,CAAC;KAC5B;IAED,IAAI,CAAC,qBAAqB,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;AACrD,CAAC;AAlCD,0DAkCC"}