isaacscript 2.0.14-dev.7 → 2.0.14
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/LICENSE +674 -0
- package/README.md +4 -6
- package/file-templates/dynamic/gitignore +3 -0
- package/file-templates/static/{.eslintrc.js → .eslintrc.js.template} +0 -0
- package/file-templates/static/.github/workflows/ci.yml +4 -3
- package/file-templates/static/.prettierignore +1 -1
- package/file-templates/static/check-orphaned-words.sh +3 -3
- package/file-templates/static/{.cspell.json.template → cspell.json.template} +1 -1
- package/file-templates/static-alt/.prettierignore-base +1 -1
- package/package.json +6 -2
- package/src/checkForWindowsTerminalBugs.js +75 -79
- package/src/checkForWindowsTerminalBugs.js.map +1 -1
- package/src/commands/copy/copy.js +32 -32
- package/src/commands/init/checkIfProjectPathExists.js +27 -29
- package/src/commands/init/checkIfProjectPathExists.js.map +1 -1
- package/src/commands/init/checkModSubdirectory.js +15 -15
- package/src/commands/init/checkModTargetDirectory.js +30 -32
- package/src/commands/init/checkModTargetDirectory.js.map +1 -1
- package/src/commands/init/createMod.js +142 -137
- package/src/commands/init/createMod.js.map +1 -1
- package/src/commands/init/getModsDir.js +55 -57
- package/src/commands/init/getModsDir.js.map +1 -1
- package/src/commands/init/getProjectPath.js +88 -92
- package/src/commands/init/getProjectPath.js.map +1 -1
- package/src/commands/init/git.js +150 -152
- package/src/commands/init/git.js.map +1 -1
- package/src/commands/init/init.js +65 -69
- package/src/commands/init/init.js.map +1 -1
- package/src/commands/init/installVSCodeExtensions.js +32 -32
- package/src/commands/init/promptSaveSlot.js +21 -24
- package/src/commands/init/promptSaveSlot.js.map +1 -1
- package/src/commands/init/promptVSCode.js +24 -26
- package/src/commands/init/promptVSCode.js.map +1 -1
- package/src/commands/monitor/constants.js +4 -4
- package/src/commands/monitor/copyWatcherMod.js +38 -38
- package/src/commands/monitor/modDirectorySyncer/modDirectorySyncer.js +49 -49
- package/src/commands/monitor/monitor.js +146 -146
- package/src/commands/monitor/notifyGame.js +57 -57
- package/src/commands/monitor/saveDatWriter/saveDatWriter.js +116 -116
- package/src/commands/monitor/saveDatWriter/types.js +2 -2
- package/src/commands/monitor/spawnSaveDatWriter.js +34 -34
- package/src/commands/monitor/touchWatcherSaveDatFiles.js +20 -20
- package/src/commands/publish/publish.js +220 -220
- package/src/configFile.js +63 -65
- package/src/configFile.js.map +1 -1
- package/src/constants.js +59 -59
- package/src/exec.js +95 -95
- package/src/file.js +193 -193
- package/src/main.js +117 -121
- package/src/main.js.map +1 -1
- package/src/parseArgs.js +106 -106
- package/src/prompt.js +86 -92
- package/src/prompt.js.map +1 -1
- package/src/types/Command.js +4 -4
- package/src/types/Config.js +12 -12
- package/src/types/GitHubCLIHostsYAML.js +2 -2
- package/src/utils.js +81 -81
- package/src/validateInIsaacScriptProject.js +26 -26
- package/src/validateNodeVersion.js +24 -24
- package/src/validateOS.js +16 -16
- package/file-templates/static/.gitattributes +0 -9
- package/file-templates/static/nuke.sh +0 -18
- package/file-templates/static/publish.sh +0 -10
- package/src/checkForWindowsTerminalBugs.d.ts +0 -5
- package/src/commands/copy/copy.d.ts +0 -3
- package/src/commands/init/checkIfProjectPathExists.d.ts +0 -1
- package/src/commands/init/checkModSubdirectory.d.ts +0 -1
- package/src/commands/init/checkModTargetDirectory.d.ts +0 -1
- package/src/commands/init/createMod.d.ts +0 -1
- package/src/commands/init/getModsDir.d.ts +0 -1
- package/src/commands/init/getProjectPath.d.ts +0 -1
- package/src/commands/init/git.d.ts +0 -4
- package/src/commands/init/init.d.ts +0 -1
- package/src/commands/init/installVSCodeExtensions.d.ts +0 -1
- package/src/commands/init/promptSaveSlot.d.ts +0 -1
- package/src/commands/init/promptVSCode.d.ts +0 -1
- package/src/commands/monitor/constants.d.ts +0 -1
- package/src/commands/monitor/copyWatcherMod.d.ts +0 -2
- package/src/commands/monitor/modDirectorySyncer/modDirectorySyncer.d.ts +0 -1
- package/src/commands/monitor/monitor.d.ts +0 -2
- package/src/commands/monitor/notifyGame.d.ts +0 -3
- package/src/commands/monitor/saveDatWriter/saveDatWriter.d.ts +0 -1
- package/src/commands/monitor/saveDatWriter/types.d.ts +0 -5
- package/src/commands/monitor/spawnSaveDatWriter.d.ts +0 -4
- package/src/commands/monitor/touchWatcherSaveDatFiles.d.ts +0 -2
- package/src/commands/publish/publish.d.ts +0 -2
- package/src/configFile.d.ts +0 -4
- package/src/constants.d.ts +0 -34
- package/src/exec.d.ts +0 -4
- package/src/file.d.ts +0 -12
- package/src/main.d.ts +0 -2
- package/src/parseArgs.d.ts +0 -1
- package/src/prompt.d.ts +0 -5
- package/src/types/Command.d.ts +0 -2
- package/src/types/Config.d.ts +0 -18
- package/src/types/GitHubCLIHostsYAML.d.ts +0 -7
- package/src/utils.d.ts +0 -13
- package/src/validateInIsaacScriptProject.d.ts +0 -1
- package/src/validateNodeVersion.d.ts +0 -5
- package/src/validateOS.d.ts +0 -1
package/README.md
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
# isaacscript-cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/isaacscript)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
IsaacScript is a tool to help you create _Binding of Isaac: Repentance_ mods using [TypeScript](https://www.typescriptlang.org/).
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Please visit the [official website](https://isaacscript.github.io/) for more information.
|
|
8
8
|
|
|
9
|
-
|
|
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. (The binary is called `isaacscript`, not `isaacscript-cli`. The package is named `isaacscript-cli` to disambiguate it from the other projects in this monorepo.)
|
|
File without changes
|
|
@@ -7,16 +7,17 @@ jobs:
|
|
|
7
7
|
runs-on: ubuntu-latest
|
|
8
8
|
steps:
|
|
9
9
|
- name: Checkout the repository
|
|
10
|
-
uses: actions/checkout@
|
|
10
|
+
uses: actions/checkout@v3
|
|
11
11
|
|
|
12
12
|
- name: Setup Node.js
|
|
13
|
-
uses: actions/setup-node@
|
|
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@
|
|
20
|
+
uses: actions/cache@v3
|
|
20
21
|
id: node-cache
|
|
21
22
|
with:
|
|
22
23
|
path: node_modules
|
|
@@ -10,7 +10,7 @@ REPO_ROOT="$DIR"
|
|
|
10
10
|
cd "$REPO_ROOT"
|
|
11
11
|
|
|
12
12
|
# Do nothing if the configuration file does not exist.
|
|
13
|
-
CSPELL_CONFIG_NAME="
|
|
13
|
+
CSPELL_CONFIG_NAME="cspell.json"
|
|
14
14
|
CSPELL_CONFIG_PATH="$REPO_ROOT/$CSPELL_CONFIG_NAME"
|
|
15
15
|
if ! test -f "$CSPELL_CONFIG_PATH"; then
|
|
16
16
|
echo "The \"$CSPELL_CONFIG_NAME\" file does not exist. Skipping checks."
|
|
@@ -27,14 +27,14 @@ fi
|
|
|
27
27
|
# We need to move the configuration path temporarily or else the cspell command won't work properly.
|
|
28
28
|
CSPELL_CONFIG_WORDS=$(cat "$CSPELL_CONFIG_PATH" | python -c "import sys, json; print('\n'.join(json.load(sys.stdin)['words']))")
|
|
29
29
|
CSPELL_CONFIG_WITHOUT_WORDS=$(cat "$CSPELL_CONFIG_PATH" | python -c "import sys, json; config = json.load(sys.stdin); del config['words']; print(json.dumps(config))")
|
|
30
|
-
CSPELL_CONFIG_PATH_TEMP="$REPO_ROOT
|
|
30
|
+
CSPELL_CONFIG_PATH_TEMP="$REPO_ROOT/cspell-temp.json"
|
|
31
31
|
mv "$CSPELL_CONFIG_PATH" "$CSPELL_CONFIG_PATH_TEMP"
|
|
32
32
|
echo "$CSPELL_CONFIG_WITHOUT_WORDS" > "$CSPELL_CONFIG_PATH"
|
|
33
33
|
MISSPELLED_WORDS_PATH="/tmp/misspelled-words.txt"
|
|
34
34
|
npx cspell lint --no-progress --no-summary --unique --words-only | sort --ignore-case --unique > "$MISSPELLED_WORDS_PATH"
|
|
35
35
|
mv "$CSPELL_CONFIG_PATH_TEMP" "$CSPELL_CONFIG_PATH"
|
|
36
36
|
|
|
37
|
-
# Check that each "
|
|
37
|
+
# Check that each "cspell.json" word is actually being used.
|
|
38
38
|
echo "Checking for orphaned CSpell configuration words in: $CSPELL_CONFIG_PATH"
|
|
39
39
|
|
|
40
40
|
ONE_OR_MORE_FAILURES=0
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript",
|
|
3
|
-
"version": "2.0.14
|
|
4
|
-
"description": "A command line tool for managing Isaac mods written in TypeScript",
|
|
3
|
+
"version": "2.0.14",
|
|
4
|
+
"description": "A command line tool for managing Isaac mods written in TypeScript.",
|
|
5
5
|
"homepage": "https://isaacscript.github.io/",
|
|
6
6
|
"bugs": {
|
|
7
7
|
"url": "https://github.com/IsaacScript/isaacscript/issues"
|
|
@@ -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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
//
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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;
|
|
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,CAAC,OAAgB;IACrD,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,KAAK,MAAM,EAAE;QACzC,OAAO;KACR;IAED,OAAO,CAAC,KAAK,CACX,eAAK,CAAC,GAAG,CACP,kFAAkF,eAAK,CAAC,KAAK,CAC3F,aAAa,CACd,yBAAyB,CAC3B,CACF,CAAC;IACF,OAAO,CAAC,KAAK,CACX,yEAAyE,CAC1E,CAAC;IAEF,MAAM,eAAe,GAAG,MAAM,IAAA,sBAAa,EACzC,qCAAqC,CACtC,CAAC;IACF,IAAI,CAAC,eAAe,EAAE;QACpB,OAAO;KACR;IAED,uBAAuB,CAAC,OAAO,CAAC,CAAC;AACnC,CAAC;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"}
|
|
@@ -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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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;
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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;
|
|
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"}
|