isaacscript 2.0.11 → 2.0.14-dev.0
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 +2 -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 +220 -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 +122 -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
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export declare const CURRENT_DIRECTORY_NAME: string;
|
|
2
|
+
export declare const CWD: string;
|
|
3
|
+
export declare const HOME_DIR: string;
|
|
4
|
+
export declare const FILE_SYNCED_MESSAGE = "File synced:";
|
|
5
|
+
export declare const MOD_UPLOADER_PATH = "C:\\Program Files (x86)\\Steam\\steamapps\\common\\The Binding of Isaac Rebirth\\tools\\ModUploader\\ModUploader.exe";
|
|
6
|
+
export declare const PROJECT_NAME = "IsaacScript";
|
|
7
|
+
export declare const DISABLE_IT_FILE = "disable.it";
|
|
8
|
+
export declare const WATCHER_MOD_NAME = "isaacscript-watcher";
|
|
9
|
+
export declare const WATCHER_MOD_SOURCE_PATH: string;
|
|
10
|
+
export declare const TEMPLATES_STATIC_DIR: string;
|
|
11
|
+
export declare const GITIGNORE = "gitignore";
|
|
12
|
+
export declare const GITIGNORE_TEMPLATE_PATH: string;
|
|
13
|
+
export declare const MAIN_TS = "main.ts";
|
|
14
|
+
export declare const MAIN_TS_TEMPLATE_PATH: string;
|
|
15
|
+
export declare const METADATA_XML = "metadata.xml";
|
|
16
|
+
export declare const METADATA_XML_TEMPLATE_PATH: string;
|
|
17
|
+
export declare const METADATA_VDF = "metadata.vdf";
|
|
18
|
+
export declare const METADATA_VDF_TEMPLATE_PATH: string;
|
|
19
|
+
export declare const PACKAGE_JSON = "package.json";
|
|
20
|
+
export declare const PACKAGE_JSON_TEMPLATE_PATH: string;
|
|
21
|
+
export declare const README_MD = "README.md";
|
|
22
|
+
export declare const README_MD_TEMPLATES_PATH: string;
|
|
23
|
+
export declare const CONFIG_FILE_NAME = "isaacscript.json";
|
|
24
|
+
export declare const CONFIG_FILE_PATH: string;
|
|
25
|
+
export declare const TSCONFIG_PATH: string;
|
|
26
|
+
export declare const PACKAGE_JSON_PATH: string;
|
|
27
|
+
export declare const CONSTANTS_TS_PATH: string;
|
|
28
|
+
export declare const YARN_LOCK_PATH: string;
|
|
29
|
+
export declare const MOD_SOURCE_PATH: string;
|
|
30
|
+
export declare const MAIN_LUA = "main.lua";
|
|
31
|
+
export declare const METADATA_XML_PATH: string;
|
|
32
|
+
export declare const VERSION_TXT_PATH: string;
|
|
33
|
+
export declare const PUBLISH_PRE_COPY_PY_PATH: string;
|
|
34
|
+
export declare const PUBLISH_POST_COPY_PY_PATH: string;
|
|
@@ -1,62 +1,60 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
exports.
|
|
17
|
-
exports.
|
|
18
|
-
exports.
|
|
19
|
-
exports.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
// `isaacscript`
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
exports.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
// `isaacscript/file-templates`
|
|
29
|
-
|
|
30
|
-
// `isaacscript/file-templates/
|
|
31
|
-
|
|
32
|
-
//
|
|
33
|
-
|
|
34
|
-
exports.
|
|
35
|
-
exports.
|
|
36
|
-
exports.
|
|
37
|
-
exports.
|
|
38
|
-
exports.
|
|
39
|
-
exports.
|
|
40
|
-
exports.
|
|
41
|
-
exports.
|
|
42
|
-
exports.
|
|
43
|
-
exports.
|
|
44
|
-
|
|
45
|
-
exports.
|
|
46
|
-
|
|
47
|
-
exports.
|
|
48
|
-
exports.
|
|
49
|
-
exports.
|
|
50
|
-
exports.
|
|
51
|
-
|
|
52
|
-
exports.
|
|
53
|
-
|
|
54
|
-
exports.
|
|
55
|
-
exports.
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
exports.PUBLISH_PRE_COPY_PY_PATH = path_1.default.join(SCRIPTS_PATH, "publish_pre_copy.py");
|
|
61
|
-
exports.PUBLISH_POST_COPY_PY_PATH = path_1.default.join(SCRIPTS_PATH, "publish_post_copy.py");
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PUBLISH_POST_COPY_PY_PATH = exports.PUBLISH_PRE_COPY_PY_PATH = exports.VERSION_TXT_PATH = exports.METADATA_XML_PATH = exports.MAIN_LUA = exports.MOD_SOURCE_PATH = exports.YARN_LOCK_PATH = exports.CONSTANTS_TS_PATH = exports.PACKAGE_JSON_PATH = exports.TSCONFIG_PATH = exports.CONFIG_FILE_PATH = exports.CONFIG_FILE_NAME = exports.README_MD_TEMPLATES_PATH = exports.README_MD = exports.PACKAGE_JSON_TEMPLATE_PATH = exports.PACKAGE_JSON = exports.METADATA_VDF_TEMPLATE_PATH = exports.METADATA_VDF = exports.METADATA_XML_TEMPLATE_PATH = exports.METADATA_XML = exports.MAIN_TS_TEMPLATE_PATH = exports.MAIN_TS = exports.GITIGNORE_TEMPLATE_PATH = exports.GITIGNORE = exports.TEMPLATES_STATIC_DIR = exports.WATCHER_MOD_SOURCE_PATH = exports.WATCHER_MOD_NAME = exports.DISABLE_IT_FILE = exports.PROJECT_NAME = exports.MOD_UPLOADER_PATH = exports.FILE_SYNCED_MESSAGE = exports.HOME_DIR = exports.CWD = exports.CURRENT_DIRECTORY_NAME = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const os_1 = tslib_1.__importDefault(require("os"));
|
|
6
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
7
|
+
const cwd = process.cwd();
|
|
8
|
+
/**
|
|
9
|
+
* From:
|
|
10
|
+
* https://stackoverflow.com/questions/9080085/node-js-find-home-directory-in-platform-agnostic-way
|
|
11
|
+
*/
|
|
12
|
+
const homeDir = os_1.default.homedir();
|
|
13
|
+
// Miscellaneous
|
|
14
|
+
exports.CURRENT_DIRECTORY_NAME = path_1.default.basename(cwd);
|
|
15
|
+
exports.CWD = cwd;
|
|
16
|
+
exports.HOME_DIR = homeDir;
|
|
17
|
+
exports.FILE_SYNCED_MESSAGE = "File synced:";
|
|
18
|
+
exports.MOD_UPLOADER_PATH = "C:\\Program Files (x86)\\Steam\\steamapps\\common\\The Binding of Isaac Rebirth\\tools\\ModUploader\\ModUploader.exe";
|
|
19
|
+
exports.PROJECT_NAME = "IsaacScript";
|
|
20
|
+
// `isaacscript`
|
|
21
|
+
const REPO_ROOT = path_1.default.join(__dirname, "..", "..");
|
|
22
|
+
// `isaacscript/isaacscript-watcher`
|
|
23
|
+
exports.DISABLE_IT_FILE = "disable.it";
|
|
24
|
+
exports.WATCHER_MOD_NAME = "isaacscript-watcher";
|
|
25
|
+
exports.WATCHER_MOD_SOURCE_PATH = path_1.default.join(REPO_ROOT, exports.WATCHER_MOD_NAME);
|
|
26
|
+
// `isaacscript/file-templates`
|
|
27
|
+
const TEMPLATES_DIR = path_1.default.join(REPO_ROOT, "file-templates");
|
|
28
|
+
// `isaacscript/file-templates/static`
|
|
29
|
+
exports.TEMPLATES_STATIC_DIR = path_1.default.join(TEMPLATES_DIR, "static");
|
|
30
|
+
// `isaacscript/file-templates/dynamic`
|
|
31
|
+
const TEMPLATES_DYNAMIC_DIR = path_1.default.join(TEMPLATES_DIR, "dynamic");
|
|
32
|
+
exports.GITIGNORE = "gitignore"; // Not named ".gitignore" to prevent NPM from deleting it
|
|
33
|
+
exports.GITIGNORE_TEMPLATE_PATH = path_1.default.join(TEMPLATES_DYNAMIC_DIR, exports.GITIGNORE);
|
|
34
|
+
exports.MAIN_TS = "main.ts";
|
|
35
|
+
exports.MAIN_TS_TEMPLATE_PATH = path_1.default.join(TEMPLATES_DYNAMIC_DIR, exports.MAIN_TS);
|
|
36
|
+
exports.METADATA_XML = "metadata.xml";
|
|
37
|
+
exports.METADATA_XML_TEMPLATE_PATH = path_1.default.join(TEMPLATES_DYNAMIC_DIR, exports.METADATA_XML);
|
|
38
|
+
exports.METADATA_VDF = "metadata.vdf";
|
|
39
|
+
exports.METADATA_VDF_TEMPLATE_PATH = path_1.default.join(TEMPLATES_DYNAMIC_DIR, exports.METADATA_VDF);
|
|
40
|
+
exports.PACKAGE_JSON = "package.json";
|
|
41
|
+
exports.PACKAGE_JSON_TEMPLATE_PATH = path_1.default.join(TEMPLATES_DYNAMIC_DIR, exports.PACKAGE_JSON);
|
|
42
|
+
exports.README_MD = "README.md";
|
|
43
|
+
exports.README_MD_TEMPLATES_PATH = path_1.default.join(TEMPLATES_DYNAMIC_DIR, exports.README_MD);
|
|
44
|
+
// `project`
|
|
45
|
+
exports.CONFIG_FILE_NAME = "isaacscript.json";
|
|
46
|
+
exports.CONFIG_FILE_PATH = path_1.default.join(exports.CWD, exports.CONFIG_FILE_NAME);
|
|
47
|
+
exports.TSCONFIG_PATH = path_1.default.join(exports.CWD, "tsconfig.json");
|
|
48
|
+
exports.PACKAGE_JSON_PATH = path_1.default.join(exports.CWD, "package.json");
|
|
49
|
+
exports.CONSTANTS_TS_PATH = path_1.default.join(exports.CWD, "src", "constants.ts");
|
|
50
|
+
exports.YARN_LOCK_PATH = path_1.default.join(exports.CWD, "yarn.lock");
|
|
51
|
+
// `project/mod`
|
|
52
|
+
exports.MOD_SOURCE_PATH = path_1.default.join(exports.CWD, "mod");
|
|
53
|
+
exports.MAIN_LUA = "main.lua";
|
|
54
|
+
exports.METADATA_XML_PATH = path_1.default.join(exports.MOD_SOURCE_PATH, "metadata.xml");
|
|
55
|
+
exports.VERSION_TXT_PATH = path_1.default.join(exports.MOD_SOURCE_PATH, "version.txt");
|
|
56
|
+
// `project/scripts`
|
|
57
|
+
const SCRIPTS_PATH = path_1.default.join(exports.CWD, "scripts");
|
|
58
|
+
exports.PUBLISH_PRE_COPY_PY_PATH = path_1.default.join(SCRIPTS_PATH, "publish_pre_copy.py");
|
|
59
|
+
exports.PUBLISH_POST_COPY_PY_PATH = path_1.default.join(SCRIPTS_PATH, "publish_post_copy.py");
|
|
62
60
|
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../packages/isaacscript-cli/src/constants.ts"],"names":[],"mappings":";;;;AAAA,oDAAoB;AACpB,wDAAwB;AAExB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;AAE1B;;;GAGG;AACH,MAAM,OAAO,GAAG,YAAE,CAAC,OAAO,EAAE,CAAC;AAE7B,gBAAgB;AACH,QAAA,sBAAsB,GAAG,cAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AAC5C,QAAA,GAAG,GAAG,GAAG,CAAC;AACV,QAAA,QAAQ,GAAG,OAAO,CAAC;AACnB,QAAA,mBAAmB,GAAG,cAAc,CAAC;AACrC,QAAA,iBAAiB,GAC5B,sHAAsH,CAAC;AAC5G,QAAA,YAAY,GAAG,aAAa,CAAC;AAE1C,gBAAgB;AAChB,MAAM,SAAS,GAAG,cAAI,CAAC,IAAI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AAS,CACV,CAAC;AAEF,YAAY;AACC,QAAA,gBAAgB,GAAG,kBAAkB,CAAC;AACtC,QAAA,gBAAgB,GAAG,cAAI,CAAC,IAAI,CAAC,WAAG,EAAE,wBAAgB,CAAC,CAAC;AACpD,QAAA,aAAa,GAAG,cAAI,CAAC,IAAI,CAAC,WAAG,EAAE,eAAe,CAAC,CAAC;AAChD,QAAA,iBAAiB,GAAG,cAAI,CAAC,IAAI,CAAC,WAAG,EAAE,cAAc,CAAC,CAAC;AACnD,QAAA,iBAAiB,GAAG,cAAI,CAAC,IAAI,CAAC,WAAG,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC;AAC1D,QAAA,cAAc,GAAG,cAAI,CAAC,IAAI,CAAC,WAAG,EAAE,WAAW,CAAC,CAAC;AAE1D,gBAAgB;AACH,QAAA,eAAe,GAAG,cAAI,CAAC,IAAI,CAAC,WAAG,EAAE,KAAK,CAAC,CAAC;AACxC,QAAA,QAAQ,GAAG,UAAU,CAAC;AACtB,QAAA,iBAAiB,GAAG,cAAI,CAAC,IAAI,CAAC,uBAAe,EAAE,cAAc,CAAC,CAAC;AAC/D,QAAA,gBAAgB,GAAG,cAAI,CAAC,IAAI,CAAC,uBAAe,EAAE,aAAa,CAAC,CAAC;AAE1E,oBAAoB;AACpB,MAAM,YAAY,GAAG,cAAI,CAAC,IAAI,CAAC,WAAG,EAAE,SAAS,CAAC,CAAC;AAClC,QAAA,wBAAwB,GAAG,cAAI,CAAC,IAAI,CAC/C,YAAY,EACZ,qBAAqB,CACtB,CAAC;AACW,QAAA,yBAAyB,GAAG,cAAI,CAAC,IAAI,CAChD,YAAY,EACZ,sBAAsB,CACvB,CAAC"}
|
package/src/exec.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function execExe(path: string, verbose: boolean, cwd?: string): string;
|
|
2
|
+
export declare function execPowershell(command: string, verbose?: boolean, cwd?: string): string;
|
|
3
|
+
/** Returns a tuple of exit status and stdout. The stdout is trimmed for convenience. */
|
|
4
|
+
export declare function execShell(command: string, args?: string[], verbose?: boolean, allowFailure?: boolean, cwd?: string): [exitStatus: number, stdout: string];
|
package/{dist/src → src}/exec.js
RENAMED
|
@@ -1,98 +1,96 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
console.error(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
exports.execShell = execShell;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.execShell = exports.execPowershell = exports.execExe = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
|
+
const child_process_1 = require("child_process");
|
|
7
|
+
const constants_1 = require("./constants");
|
|
8
|
+
const utils_1 = require("./utils");
|
|
9
|
+
function execExe(path, verbose, cwd = constants_1.CWD) {
|
|
10
|
+
if (verbose) {
|
|
11
|
+
console.log(`Executing binary: ${path}`);
|
|
12
|
+
}
|
|
13
|
+
let stdout;
|
|
14
|
+
try {
|
|
15
|
+
const buffer = (0, child_process_1.execSync)(`"${path}"`, {
|
|
16
|
+
cwd,
|
|
17
|
+
});
|
|
18
|
+
stdout = buffer.toString().trim();
|
|
19
|
+
}
|
|
20
|
+
catch (err) {
|
|
21
|
+
(0, utils_1.error)(`Failed to run "${chalk_1.default.green(path)}":`, err);
|
|
22
|
+
}
|
|
23
|
+
if (verbose) {
|
|
24
|
+
console.log(`Executed binary: ${path}`);
|
|
25
|
+
}
|
|
26
|
+
return stdout;
|
|
27
|
+
}
|
|
28
|
+
exports.execExe = execExe;
|
|
29
|
+
function execPowershell(command, verbose = false, cwd = constants_1.CWD) {
|
|
30
|
+
if (verbose) {
|
|
31
|
+
console.log(`Executing PowerShell command: ${command}`);
|
|
32
|
+
}
|
|
33
|
+
let stdout;
|
|
34
|
+
try {
|
|
35
|
+
const buffer = (0, child_process_1.execSync)(command, {
|
|
36
|
+
shell: "powershell.exe",
|
|
37
|
+
cwd,
|
|
38
|
+
});
|
|
39
|
+
stdout = buffer.toString().trim();
|
|
40
|
+
}
|
|
41
|
+
catch (err) {
|
|
42
|
+
(0, utils_1.error)(`Failed to run PowerShell command "${chalk_1.default.green(command)}":`, err);
|
|
43
|
+
}
|
|
44
|
+
if (verbose) {
|
|
45
|
+
console.log(`Executed PowerShell command: ${command}`);
|
|
46
|
+
}
|
|
47
|
+
return stdout;
|
|
48
|
+
}
|
|
49
|
+
exports.execPowershell = execPowershell;
|
|
50
|
+
/** Returns a tuple of exit status and stdout. The stdout is trimmed for convenience. */
|
|
51
|
+
function execShell(command, args = [], verbose = false, allowFailure = false, cwd = constants_1.CWD) {
|
|
52
|
+
// On Windows, "spawnSync()" will not account for spaces in arguments. Thus, wrap everything in a
|
|
53
|
+
// double quote. This will cause arguments that naturally have double quotes to fail.
|
|
54
|
+
if (command.includes('"')) {
|
|
55
|
+
(0, utils_1.error)("execShell cannot execute commands with double quotes in the command.");
|
|
56
|
+
}
|
|
57
|
+
const argsHasDoubleQuotes = args.some((arg) => arg.includes('"'));
|
|
58
|
+
if (argsHasDoubleQuotes) {
|
|
59
|
+
(0, utils_1.error)("execShell cannot execute commands with double quotes in the arguments.");
|
|
60
|
+
}
|
|
61
|
+
const quotedArgs = args.map((arg) => `"${arg}"`);
|
|
62
|
+
const commandDescription = `${command} ${quotedArgs.join(" ")}`.trim();
|
|
63
|
+
if (verbose) {
|
|
64
|
+
console.log(`Executing command: ${commandDescription}`);
|
|
65
|
+
}
|
|
66
|
+
let spawnSyncReturns;
|
|
67
|
+
try {
|
|
68
|
+
spawnSyncReturns = (0, child_process_1.spawnSync)(command, args, {
|
|
69
|
+
shell: true,
|
|
70
|
+
cwd,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
catch (err) {
|
|
74
|
+
(0, utils_1.error)(`Failed to run the "${chalk_1.default.green(commandDescription)}" command:`, err);
|
|
75
|
+
}
|
|
76
|
+
if (verbose) {
|
|
77
|
+
console.log(`Executed command: ${commandDescription}`);
|
|
78
|
+
}
|
|
79
|
+
const exitStatus = spawnSyncReturns.status;
|
|
80
|
+
if (exitStatus === null) {
|
|
81
|
+
(0, utils_1.error)(`Failed to get the return status of command: ${commandDescription}`);
|
|
82
|
+
}
|
|
83
|
+
const stdout = spawnSyncReturns.output.join("\n").trim();
|
|
84
|
+
if (exitStatus !== 0) {
|
|
85
|
+
if (allowFailure) {
|
|
86
|
+
return [exitStatus, stdout];
|
|
87
|
+
}
|
|
88
|
+
console.error(`Failed to run the "${chalk_1.default.green(commandDescription)}" command with an exit code of ${exitStatus}.`);
|
|
89
|
+
console.error("The output was as follows:");
|
|
90
|
+
console.error(stdout);
|
|
91
|
+
process.exit(1);
|
|
92
|
+
}
|
|
93
|
+
return [exitStatus, stdout];
|
|
94
|
+
}
|
|
95
|
+
exports.execShell = execShell;
|
|
98
96
|
//# sourceMappingURL=exec.js.map
|
package/src/exec.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exec.js","sourceRoot":"","sources":["../../../../packages/isaacscript-cli/src/exec.ts"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAC1B,iDAAsE;AACtE,2CAAkC;AAClC,mCAAgC;AAEhC,SAAgB,OAAO,CAAC,IAAY,EAAE,OAAgB,EAAE,GAAG,GAAG,eAAG;IAC/D,IAAI,OAAO,EAAE;QACX,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,EAAE,CAAC,CAAC;KAC1C;IAED,IAAI,MAAc,CAAC;IACnB,IAAI;QACF,MAAM,MAAM,GAAG,IAAA,wBAAQ,EAAC,IAAI,IAAI,GAAG,EAAE;YACnC,GAAG;SACJ,CAAC,CAAC;QACH,MAAM,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC;KACnC;IAAC,OAAO,GAAG,EAAE;QACZ,IAAA,aAAK,EAAC,kBAAkB,eAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;KACrD;IAED,IAAI,OAAO,EAAE;QACX,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,EAAE,CAAC,CAAC;KACzC;IAED,OA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AC,CAAC,CAAC,CAAC;KACjB;IAED,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;AAC9B,CAAC;AArED,8BAqEC"}
|
package/src/file.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare function copy(srcPath: string, dstPath: string, verbose: boolean): void;
|
|
2
|
+
export declare function deleteFileOrDirectory(filePath: string, verbose: boolean): void;
|
|
3
|
+
export declare function exists(filePath: string, verbose: boolean): boolean;
|
|
4
|
+
export declare function getDirList(dirPath: string, verbose: boolean): string[];
|
|
5
|
+
export declare function isDir(filePath: string, verbose: boolean): boolean;
|
|
6
|
+
export declare function isSubDirOf(dir: string, parent: string): boolean;
|
|
7
|
+
export declare function makeDir(dirPath: string, verbose: boolean): void;
|
|
8
|
+
export declare function read(filePath: string, verbose: boolean): string;
|
|
9
|
+
export declare function rename(srcPath: string, dstPath: string, verbose: boolean): void;
|
|
10
|
+
export declare function touch(filePath: string, verbose: boolean): void;
|
|
11
|
+
export declare function write(filePath: string, data: string, verbose: boolean): void;
|
|
12
|
+
export declare function writeTry(filePath: string, data: string, verbose: boolean): void;
|