isaacscript 1.2.27 → 1.2.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/package.json +5 -5
- package/dist/src/commands/copy/copy.js +0 -1
- package/dist/src/commands/copy/copy.js.map +1 -1
- package/dist/src/commands/init/checkIfProjectPathExists.js +14 -8
- package/dist/src/commands/init/checkIfProjectPathExists.js.map +1 -1
- package/dist/src/commands/init/checkModSubdirectory.js +2 -2
- package/dist/src/commands/init/checkModSubdirectory.js.map +1 -1
- package/dist/src/commands/init/checkModTargetDirectory.js +12 -6
- package/dist/src/commands/init/checkModTargetDirectory.js.map +1 -1
- package/dist/src/commands/init/createMod.js +11 -96
- package/dist/src/commands/init/createMod.js.map +1 -1
- package/dist/src/commands/init/getProjectPath.js +13 -4
- package/dist/src/commands/init/getProjectPath.js.map +1 -1
- package/dist/src/commands/init/git.js +176 -0
- package/dist/src/commands/init/git.js.map +1 -0
- package/dist/src/commands/init/init.js +11 -6
- package/dist/src/commands/init/init.js.map +1 -1
- package/dist/src/commands/init/promptSaveSlot.js +4 -1
- package/dist/src/commands/init/promptSaveSlot.js.map +1 -1
- package/dist/src/commands/monitor/modDirectorySyncer/modDirectorySyncer.js +0 -5
- package/dist/src/commands/monitor/modDirectorySyncer/modDirectorySyncer.js.map +1 -1
- package/dist/src/commands/publish/publish.js +3 -20
- package/dist/src/commands/publish/publish.js.map +1 -1
- package/dist/src/configFile.js +4 -3
- package/dist/src/configFile.js.map +1 -1
- package/dist/src/parseArgs.js +5 -0
- package/dist/src/parseArgs.js.map +1 -1
- package/dist/src/prompt.js +1 -0
- package/dist/src/prompt.js.map +1 -1
- package/{src → file-templates/static}/plugins/addCrashDebugStatements.ts +0 -0
- package/file-templates/static/plugins/addIsaacScriptCommentHeader.ts +35 -0
- package/file-templates/static/tsconfig.json +8 -0
- package/isaacscript-watcher/metadata.xml +5 -5
- package/package.json +5 -5
- package/src/commands/copy/copy.ts +0 -1
- package/src/commands/init/checkIfProjectPathExists.ts +19 -12
- package/src/commands/init/checkModSubdirectory.ts +2 -2
- package/src/commands/init/checkModTargetDirectory.ts +17 -11
- package/src/commands/init/createMod.ts +21 -170
- package/src/commands/init/getProjectPath.ts +14 -4
- package/src/commands/init/git.ts +248 -0
- package/src/commands/init/init.ts +21 -6
- package/src/commands/init/promptSaveSlot.ts +5 -0
- package/src/commands/monitor/modDirectorySyncer/modDirectorySyncer.ts +0 -6
- package/src/commands/publish/publish.ts +1 -25
- package/src/configFile.ts +5 -4
- package/src/exec.ts +1 -1
- package/src/parseArgs.ts +6 -0
- package/src/prompt.ts +1 -0
- package/dist/src/monkeyPatch.js +0 -82
- package/dist/src/monkeyPatch.js.map +0 -1
- package/dist/src/plugins/addCrashDebugStatements.js +0 -44
- package/dist/src/plugins/addCrashDebugStatements.js.map +0 -1
- package/src/monkeyPatch.ts +0 -62
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.30",
|
|
4
4
|
"description": "A command line tool for managing Isaac mods written in TypeScript",
|
|
5
5
|
"homepage": "https://isaacscript.github.io/",
|
|
6
6
|
"bugs": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"isaacscript": "./dist/src/main.js"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@types/node": "^17.0.
|
|
19
|
+
"@types/node": "^17.0.23",
|
|
20
20
|
"chalk": "4.1.2",
|
|
21
21
|
"command-exists": "^1.2.9",
|
|
22
22
|
"dotenv": "^16.0.0",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"source-map-support": "^0.5.21",
|
|
32
32
|
"sync-directory": "^4.0.12",
|
|
33
33
|
"ts-node": "^10.7.0",
|
|
34
|
-
"typescript": "^4.6.
|
|
35
|
-
"typescript-to-lua": "^1.4.
|
|
34
|
+
"typescript": "^4.6.3",
|
|
35
|
+
"typescript-to-lua": "^1.4.2",
|
|
36
36
|
"update-notifier": "^5.1.0",
|
|
37
37
|
"yaml": "^1.10.2",
|
|
38
38
|
"yargs": "^17.4.0"
|
|
@@ -45,6 +45,6 @@
|
|
|
45
45
|
"@types/source-map-support": "^0.5.4",
|
|
46
46
|
"@types/update-notifier": "^5.1.0",
|
|
47
47
|
"@types/yargs": "^17.0.10",
|
|
48
|
-
"isaacscript-lint": "^1.0.
|
|
48
|
+
"isaacscript-lint": "^1.0.95"
|
|
49
49
|
}
|
|
50
50
|
}
|
|
@@ -41,7 +41,6 @@ function copy(argv, config) {
|
|
|
41
41
|
exports.copy = copy;
|
|
42
42
|
function compileAndCopy(modSourcePath, modTargetPath, verbose) {
|
|
43
43
|
compile(verbose);
|
|
44
|
-
// monkeyPatchMainLua(modSourcePath);
|
|
45
44
|
copyMod(modSourcePath, modTargetPath, verbose);
|
|
46
45
|
}
|
|
47
46
|
exports.compileAndCopy = compileAndCopy;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy.js","sourceRoot":"","sources":["../../../../src/commands/copy/copy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAwB;AACxB,+CAAkD;AAClD,qCAAuC;AACvC,iDAAmC;AAEnC,uCAAwD;AAExD,SAAgB,IAAI,CAAC,IAA6B,EAAE,MAAc;IAChE,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC;IAEtC,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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,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -32,16 +32,22 @@ const constants_1 = require("../../constants");
|
|
|
32
32
|
const file = __importStar(require("../../file"));
|
|
33
33
|
const prompt_1 = require("../../prompt");
|
|
34
34
|
const utils_1 = require("../../utils");
|
|
35
|
-
async function checkIfProjectPathExists(projectPath, verbose) {
|
|
36
|
-
if (projectPath
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
(0, utils_1.error)("Ok then. Good-bye.");
|
|
42
|
-
}
|
|
35
|
+
async function checkIfProjectPathExists(projectPath, yes, verbose) {
|
|
36
|
+
if (projectPath === constants_1.CWD || !file.exists(projectPath)) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const fileType = file.isDir(projectPath) ? "directory" : "file";
|
|
40
|
+
if (yes) {
|
|
43
41
|
file.deleteFileOrDirectory(projectPath, verbose);
|
|
42
|
+
console.log(`Deleted ${fileType}: ${chalk_1.default.green(projectPath)}`);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
console.log(`A ${fileType} already exists with a name of: ${chalk_1.default.green(projectPath)}`);
|
|
46
|
+
const shouldDelete = await (0, prompt_1.getInputYesNo)("Do you want me to delete it?");
|
|
47
|
+
if (!shouldDelete) {
|
|
48
|
+
(0, utils_1.error)("Ok then. Goodbye.");
|
|
44
49
|
}
|
|
50
|
+
file.deleteFileOrDirectory(projectPath, verbose);
|
|
45
51
|
}
|
|
46
52
|
exports.checkIfProjectPathExists = checkIfProjectPathExists;
|
|
47
53
|
//# sourceMappingURL=checkIfProjectPathExists.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkIfProjectPathExists.js","sourceRoot":"","sources":["../../../../src/commands/init/checkIfProjectPathExists.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,+CAAsC;AACtC,iDAAmC;AACnC,yCAA6C;AAC7C,uCAAoC;AAE7B,KAAK,UAAU,wBAAwB,CAC5C,WAAmB,EACnB,OAAgB;IAEhB,IAAI,WAAW,KAAK,eAAG,IAAI,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE;
|
|
1
|
+
{"version":3,"file":"checkIfProjectPathExists.js","sourceRoot":"","sources":["../../../../src/commands/init/checkIfProjectPathExists.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,+CAAsC;AACtC,iDAAmC;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,CAAC,EAAE;QACpD,OAAO;KACR;IAED,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC;IAEhE,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"}
|
|
@@ -30,11 +30,11 @@ exports.checkModSubdirectory = void 0;
|
|
|
30
30
|
const chalk_1 = __importDefault(require("chalk"));
|
|
31
31
|
const constants_1 = require("../../constants");
|
|
32
32
|
const file = __importStar(require("../../file"));
|
|
33
|
+
const utils_1 = require("../../utils");
|
|
33
34
|
function checkModSubdirectory(projectPath, modsDirectory) {
|
|
34
35
|
if (file.isSubDirOf(constants_1.CWD, modsDirectory)) {
|
|
35
36
|
console.error(`Error: The project directory of "${chalk_1.default.green(projectPath)}" is a subdirectory of "${chalk_1.default.green(modsDirectory)}".`);
|
|
36
|
-
|
|
37
|
-
process.exit(1);
|
|
37
|
+
(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.');
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
exports.checkModSubdirectory = checkModSubdirectory;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkModSubdirectory.js","sourceRoot":"","sources":["../../../../src/commands/init/checkModSubdirectory.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,+CAAsC;AACtC,iDAAmC;
|
|
1
|
+
{"version":3,"file":"checkModSubdirectory.js","sourceRoot":"","sources":["../../../../src/commands/init/checkModSubdirectory.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,+CAAsC;AACtC,iDAAmC;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"}
|
|
@@ -33,16 +33,22 @@ const constants_1 = require("../../constants");
|
|
|
33
33
|
const file = __importStar(require("../../file"));
|
|
34
34
|
const prompt_1 = require("../../prompt");
|
|
35
35
|
const utils_1 = require("../../utils");
|
|
36
|
-
async function checkModTargetDirectory(modsDirectory, projectName, verbose) {
|
|
36
|
+
async function checkModTargetDirectory(modsDirectory, projectName, yes, verbose) {
|
|
37
37
|
const modTargetPath = path_1.default.join(modsDirectory, projectName);
|
|
38
38
|
if (!file.exists(modTargetPath)) {
|
|
39
39
|
return;
|
|
40
40
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
const fileType = file.isDir(modTargetPath) ? "directory" : "file";
|
|
42
|
+
if (yes) {
|
|
43
|
+
file.deleteFileOrDirectory(modTargetPath, verbose);
|
|
44
|
+
console.log(`Deleted ${fileType}: ${chalk_1.default.green(modTargetPath)}`);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
console.log(`A ${fileType} already exists at at the mod path of: ${chalk_1.default.green(modTargetPath)}`);
|
|
48
|
+
console.log(`${constants_1.PROJECT_NAME} will need to sync your project folder with this directory.`);
|
|
49
|
+
const shouldDelete = await (0, prompt_1.getInputYesNo)("Do you want me to delete it?");
|
|
50
|
+
if (!shouldDelete) {
|
|
51
|
+
(0, utils_1.error)("Ok then. Goodbye.");
|
|
46
52
|
}
|
|
47
53
|
file.deleteFileOrDirectory(modTargetPath, verbose);
|
|
48
54
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkModTargetDirectory.js","sourceRoot":"","sources":["../../../../src/commands/init/checkModTargetDirectory.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,gDAAwB;AACxB,+CAA+C;AAC/C,iDAAmC;AACnC,yCAA6C;AAC7C,uCAAoC;AAE7B,KAAK,UAAU,uBAAuB,CAC3C,aAAqB,EACrB,WAAmB,EACnB,OAAgB;IAEhB,MAAM,aAAa,GAAG,cAAI,CAAC,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;IAC5D,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE;QAC/B,OAAO;KACR;IAED,OAAO,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"checkModTargetDirectory.js","sourceRoot":"","sources":["../../../../src/commands/init/checkModTargetDirectory.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,gDAAwB;AACxB,+CAA+C;AAC/C,iDAAmC;AACnC,yCAA6C;AAC7C,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,CAAC,EAAE;QAC/B,OAAO;KACR;IAED,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC;IAElE,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"}
|
|
@@ -28,51 +28,30 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.createMod = void 0;
|
|
30
30
|
const chalk_1 = __importDefault(require("chalk"));
|
|
31
|
-
const command_exists_1 = __importDefault(require("command-exists"));
|
|
32
31
|
const path_1 = __importDefault(require("path"));
|
|
33
|
-
const yaml_1 = __importDefault(require("yaml"));
|
|
34
32
|
const configFile = __importStar(require("../../configFile"));
|
|
35
33
|
const constants_1 = require("../../constants");
|
|
36
34
|
const exec_1 = require("../../exec");
|
|
37
35
|
const file = __importStar(require("../../file"));
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
const REQUIRED_GIT_MAJOR_VERSION = 2;
|
|
41
|
-
const REQUIRED_GIT_MINOR_VERSION = 30;
|
|
42
|
-
async function createMod(projectName, projectPath, createNewDir, modsDirectory, saveSlot, skipNPMInstall, verbose) {
|
|
36
|
+
const git_1 = require("./git");
|
|
37
|
+
function createMod(projectName, projectPath, createNewDir, modsDirectory, saveSlot, gitRemoteURL, skipNPMInstall, verbose) {
|
|
43
38
|
if (createNewDir) {
|
|
44
39
|
file.makeDir(projectPath, verbose);
|
|
45
40
|
}
|
|
46
41
|
const config = configFile.createObject(modsDirectory, saveSlot);
|
|
47
42
|
configFile.createFile(projectPath, config, verbose);
|
|
48
43
|
const targetModDirectory = path_1.default.join(config.modsDirectory, projectName);
|
|
49
|
-
await initGitRepository(projectPath, projectName, verbose);
|
|
50
44
|
makeSubdirectories(projectPath, verbose);
|
|
51
45
|
copyStaticFiles(projectPath, verbose);
|
|
52
46
|
copyDynamicFiles(projectName, projectPath, targetModDirectory, verbose);
|
|
53
47
|
updateNodeModules(projectPath, verbose);
|
|
54
48
|
installNodeModules(projectPath, skipNPMInstall, verbose);
|
|
49
|
+
formatFiles(projectPath, verbose);
|
|
50
|
+
// Only make the initial commit once all of the files have been copied and formatted
|
|
51
|
+
(0, git_1.initGitRepository)(projectPath, gitRemoteURL, verbose);
|
|
55
52
|
console.log(`Successfully created mod: ${chalk_1.default.green(projectName)}`);
|
|
56
53
|
}
|
|
57
54
|
exports.createMod = createMod;
|
|
58
|
-
async function initGitRepository(projectPath, projectName, verbose) {
|
|
59
|
-
if (!command_exists_1.default.sync("git")) {
|
|
60
|
-
console.log('Git does not seem to be installed. (The "git" command is not in the path.) Skipping Git-related things.');
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
checkOldGitVersion(verbose);
|
|
64
|
-
const remoteURL = await getGitRemoteURL(projectName);
|
|
65
|
-
if (remoteURL === "") {
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
(0, exec_1.execShell)("git", ["init"], verbose, false, projectPath);
|
|
69
|
-
(0, exec_1.execShell)("git", ["branch", "-M", "main"], verbose, false, projectPath);
|
|
70
|
-
(0, exec_1.execShell)("git", ["remote", "add", "origin", remoteURL], verbose, false, projectPath);
|
|
71
|
-
if (isGitNameAndEmailConfigured(verbose)) {
|
|
72
|
-
(0, exec_1.execShell)("git", ["add", "--all"], verbose, false, projectPath);
|
|
73
|
-
(0, exec_1.execShell)("git", ["commit", "--message", `${constants_1.PROJECT_NAME} template`], verbose, false, projectPath);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
55
|
function makeSubdirectories(projectPath, verbose) {
|
|
77
56
|
// The "src" directory is created during copying of static files
|
|
78
57
|
for (const subdirectory of ["mod"]) {
|
|
@@ -80,7 +59,7 @@ function makeSubdirectories(projectPath, verbose) {
|
|
|
80
59
|
file.makeDir(srcPath, verbose);
|
|
81
60
|
}
|
|
82
61
|
}
|
|
83
|
-
|
|
62
|
+
/** Copy static files, like ".eslintrc.js", "tsconfig.json", etc. */
|
|
84
63
|
function copyStaticFiles(projectPath, verbose) {
|
|
85
64
|
const staticFileList = file.getDirList(constants_1.TEMPLATES_STATIC_DIR);
|
|
86
65
|
staticFileList.forEach((fileName) => {
|
|
@@ -91,7 +70,7 @@ function copyStaticFiles(projectPath, verbose) {
|
|
|
91
70
|
}
|
|
92
71
|
});
|
|
93
72
|
}
|
|
94
|
-
|
|
73
|
+
/** Copy files that need to have text replaced inside of them. */
|
|
95
74
|
function copyDynamicFiles(projectName, projectPath, targetModDirectory, verbose) {
|
|
96
75
|
// ".gitignore"
|
|
97
76
|
{
|
|
@@ -161,78 +140,11 @@ function copyDynamicFiles(projectName, projectPath, targetModDirectory, verbose)
|
|
|
161
140
|
file.write(destinationPath, mainTS, verbose);
|
|
162
141
|
}
|
|
163
142
|
}
|
|
143
|
+
/** The "package.json" file has to be copied first before this step. */
|
|
164
144
|
function updateNodeModules(projectPath, verbose) {
|
|
165
145
|
console.log("Finding out the latest versions of the NPM packages...");
|
|
166
146
|
(0, exec_1.execShell)("npx", ["npm-check-updates", "--upgrade", "--packageFile", "package.json"], verbose, false, projectPath);
|
|
167
147
|
}
|
|
168
|
-
async function getGitRemoteURL(projectName) {
|
|
169
|
-
const guessedRemoteURL = guessRemoteURL(projectName);
|
|
170
|
-
if (guessedRemoteURL !== undefined) {
|
|
171
|
-
const shouldUseGuessedURL = await (0, prompt_1.getInputYesNo)(`Do you want to use a Git remote URL of: ${chalk_1.default.green(guessedRemoteURL)}`);
|
|
172
|
-
if (shouldUseGuessedURL) {
|
|
173
|
-
return guessedRemoteURL;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
return (0, prompt_1.getInputString)(`Paste in the remote Git URL for your project.
|
|
177
|
-
For example, if you have an SSH key, it would be something like:
|
|
178
|
-
${chalk_1.default.green("git@github.com:Alice/green-candle.git")}
|
|
179
|
-
If you don't have an SSH key, it would be something like:
|
|
180
|
-
${chalk_1.default.green("https://github.com/Alice/green-candle.git")}
|
|
181
|
-
If you don't want to initialize a Git repository for this project, press enter to skip.
|
|
182
|
-
`);
|
|
183
|
-
}
|
|
184
|
-
function checkOldGitVersion(verbose) {
|
|
185
|
-
const [, stdout] = (0, exec_1.execShell)("git", ["--version"], verbose);
|
|
186
|
-
const outputPrefix = "git version ";
|
|
187
|
-
if (!stdout.startsWith(outputPrefix)) {
|
|
188
|
-
(0, utils_1.error)(`Failed to parse the output from the "git --version" command: ${stdout}`);
|
|
189
|
-
}
|
|
190
|
-
const gitVersionString = stdout.slice(outputPrefix.length);
|
|
191
|
-
const [majorVersion, minorVersion] = (0, utils_1.parseSemVer)(gitVersionString);
|
|
192
|
-
if (majorVersion >= REQUIRED_GIT_MAJOR_VERSION &&
|
|
193
|
-
minorVersion >= REQUIRED_GIT_MINOR_VERSION) {
|
|
194
|
-
return;
|
|
195
|
-
}
|
|
196
|
-
console.error(`Your Git version is: ${chalk_1.default.red(gitVersionString)}`);
|
|
197
|
-
console.error(`${constants_1.PROJECT_NAME} requires a Git version of ${chalk_1.default.red(`${REQUIRED_GIT_MAJOR_VERSION}.${REQUIRED_GIT_MINOR_VERSION}.0`)} or greater.`);
|
|
198
|
-
console.error(`Please upgrade your version of Git before using ${constants_1.PROJECT_NAME}.`);
|
|
199
|
-
process.exit(1);
|
|
200
|
-
}
|
|
201
|
-
function guessRemoteURL(projectName) {
|
|
202
|
-
const gitHubUsername = getGitHubUsername();
|
|
203
|
-
if (gitHubUsername === undefined) {
|
|
204
|
-
return undefined;
|
|
205
|
-
}
|
|
206
|
-
return `git@github.com:${gitHubUsername}/${projectName}.git`;
|
|
207
|
-
}
|
|
208
|
-
function getGitHubUsername() {
|
|
209
|
-
// If the GitHub CLI is installed, we can derive the user's GitHub username
|
|
210
|
-
if (!command_exists_1.default.sync("gh") ||
|
|
211
|
-
process.env.APPDATA === undefined ||
|
|
212
|
-
process.env.APPDATA === "") {
|
|
213
|
-
return undefined;
|
|
214
|
-
}
|
|
215
|
-
const githubCLIHostsPath = path_1.default.join(process.env.APPDATA, "GitHub CLI", "hosts.yml");
|
|
216
|
-
if (!file.exists(githubCLIHostsPath)) {
|
|
217
|
-
return undefined;
|
|
218
|
-
}
|
|
219
|
-
const configYAMLRaw = file.read(githubCLIHostsPath);
|
|
220
|
-
const configYAML = yaml_1.default.parse(configYAMLRaw);
|
|
221
|
-
const githubCom = configYAML["github.com"];
|
|
222
|
-
if (githubCom === undefined) {
|
|
223
|
-
return undefined;
|
|
224
|
-
}
|
|
225
|
-
const { user } = githubCom;
|
|
226
|
-
if (user === "") {
|
|
227
|
-
return undefined;
|
|
228
|
-
}
|
|
229
|
-
return user;
|
|
230
|
-
}
|
|
231
|
-
function isGitNameAndEmailConfigured(verbose) {
|
|
232
|
-
const [nameExitStatus] = (0, exec_1.execShell)("git", ["config", "--global", "user.name"], verbose, true);
|
|
233
|
-
const [emailExitStatus] = (0, exec_1.execShell)("git", ["config", "--global", "user.email"], verbose, true);
|
|
234
|
-
return nameExitStatus === 0 && emailExitStatus === 0;
|
|
235
|
-
}
|
|
236
148
|
function installNodeModules(projectPath, skipNPMInstall, verbose) {
|
|
237
149
|
if (skipNPMInstall) {
|
|
238
150
|
return;
|
|
@@ -240,4 +152,7 @@ function installNodeModules(projectPath, skipNPMInstall, verbose) {
|
|
|
240
152
|
console.log("Installing node modules... (This can take a long time.)");
|
|
241
153
|
(0, exec_1.execShell)("npm", ["install"], verbose, false, projectPath);
|
|
242
154
|
}
|
|
155
|
+
function formatFiles(projectPath, verbose) {
|
|
156
|
+
(0, exec_1.execShell)("npx", ["prettier", "--write", projectPath], verbose, false, projectPath);
|
|
157
|
+
}
|
|
243
158
|
//# sourceMappingURL=createMod.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createMod.js","sourceRoot":"","sources":["../../../../src/commands/init/createMod.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,
|
|
1
|
+
{"version":3,"file":"createMod.js","sourceRoot":"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AG,cAAI,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACrD,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;KAC9C;AACH,CAAC;AAED,uEAAuE;AACvE,SAAS,iBAAiB,CAAC,WAAmB,EAAE,OAAgB;IAC9D,OAAO,CAAC,GAAG,CAAC,wDAAwD,CAAC,CAAC;IACtE,IAAA,gBAAS,EACP,KAAK,EACL,CAAC,mBAAmB,EAAE,WAAW,EAAE,eAAe,EAAE,cAAc,CAAC,EACnE,OAAO,EACP,KAAK,EACL,WAAW,CACZ,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CACzB,WAAmB,EACnB,cAAuB,EACvB,OAAgB;IAEhB,IAAI,cAAc,EAAE;QAClB,OAAO;KACR;IAED,OAAO,CAAC,GAAG,CAAC,yDAAyD,CAAC,CAAC;IACvE,IAAA,gBAAS,EAAC,KAAK,EAAE,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC;AAC7D,CAAC;AAED,SAAS,WAAW,CAAC,WAAmB,EAAE,OAAgB;IACxD,IAAA,gBAAS,EACP,KAAK,EACL,CAAC,UAAU,EAAE,SAAS,EAAE,WAAW,CAAC,EACpC,OAAO,EACP,KAAK,EACL,WAAW,CACZ,CAAC;AACJ,CAAC"}
|
|
@@ -21,22 +21,29 @@ const ILLEGAL_CHARACTERS_FOR_WINDOWS_FILENAMES = [
|
|
|
21
21
|
"?",
|
|
22
22
|
"*",
|
|
23
23
|
];
|
|
24
|
-
async function getProjectPath(argv) {
|
|
24
|
+
async function getProjectPath(argv, useCurrentDir, yes) {
|
|
25
25
|
let projectName = getProjectNameFromCommandLineArgument(argv);
|
|
26
26
|
let projectPath;
|
|
27
27
|
let createNewDir;
|
|
28
|
-
if (
|
|
28
|
+
if (useCurrentDir) {
|
|
29
29
|
// The "--use-current-dir" command-line flag was specified,
|
|
30
30
|
// so there is no need to prompt the user
|
|
31
31
|
projectName = constants_1.CURRENT_DIRECTORY_NAME;
|
|
32
32
|
projectPath = constants_1.CWD;
|
|
33
33
|
createNewDir = false;
|
|
34
34
|
}
|
|
35
|
-
else if (projectName !==
|
|
35
|
+
else if (projectName !== undefined) {
|
|
36
36
|
// The project name was specified on the command-line
|
|
37
37
|
projectPath = path_1.default.join(constants_1.CWD, projectName);
|
|
38
38
|
createNewDir = true;
|
|
39
39
|
}
|
|
40
|
+
else if (yes) {
|
|
41
|
+
// The "--yes" command-line flag was specified and the project name was not specified on the
|
|
42
|
+
// command-line, so default to using the current directory
|
|
43
|
+
projectName = constants_1.CURRENT_DIRECTORY_NAME;
|
|
44
|
+
projectPath = constants_1.CWD;
|
|
45
|
+
createNewDir = false;
|
|
46
|
+
}
|
|
40
47
|
else {
|
|
41
48
|
// The project name was not specified on the command-line, so prompt the user for it
|
|
42
49
|
[projectName, projectPath, createNewDir] = await getNewProjectName();
|
|
@@ -49,7 +56,9 @@ async function getProjectPath(argv) {
|
|
|
49
56
|
}
|
|
50
57
|
exports.getProjectPath = getProjectPath;
|
|
51
58
|
function getProjectNameFromCommandLineArgument(argv) {
|
|
52
|
-
return typeof argv.name === "string" && argv.name !== ""
|
|
59
|
+
return typeof argv.name === "string" && argv.name !== ""
|
|
60
|
+
? argv.name
|
|
61
|
+
: undefined;
|
|
53
62
|
}
|
|
54
63
|
async function getNewProjectName() {
|
|
55
64
|
console.log("You did not specify a project name as a command-line argument.");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getProjectPath.js","sourceRoot":"","sources":["../../../../src/commands/init/getProjectPath.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,gDAAwB;AACxB,+CAA8D;AAC9D,yCAA6D;AAC7D,uCAA4C;AAE5C,4EAA4E;AAC5E,MAAM,wCAAwC,GAAG;IAC/C,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,IAAI;IACJ,GAAG;IACH,GAAG;IACH,GAAG;CACJ,CAAC;AAEK,KAAK,UAAU,cAAc,CAClC,IAA6B;
|
|
1
|
+
{"version":3,"file":"getProjectPath.js","sourceRoot":"","sources":["../../../../src/commands/init/getProjectPath.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,gDAAwB;AACxB,+CAA8D;AAC9D,yCAA6D;AAC7D,uCAA4C;AAE5C,4EAA4E;AAC5E,MAAM,wCAAwC,GAAG;IAC/C,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,IAAI;IACJ,GAAG;IACH,GAAG;IACH,GAAG;CACJ,CAAC;AAEK,KAAK,UAAU,cAAc,CAClC,IAA6B,EAC7B,aAAsB,EACtB,GAAY;IAEZ,IAAI,WAAW,GAAG,qCAAqC,CAAC,IAAI,CAAC,CAAC;IAC9D,IAAI,WAAmB,CAAC;IACxB,IAAI,YAAqB,CAAC;IAC1B,IAAI,aAAa,EAAE;QACjB,2DAA2D;QAC3D,yCAAyC;QACzC,WAAW,GAAG,kCAAsB,CAAC;QACrC,WAAW,GAAG,eAAG,CAAC;QAClB,YAAY,GAAG,KAAK,CAAC;KACtB;SAAM,IAAI,WAAW,KAAK,SAAS,EAAE;QACpC,qDAAqD;QACrD,WAAW,GAAG,cAAI,CAAC,IAAI,CAAC,eAAG,EAAE,WAAW,CAAC,CAAC;QAC1C,YAAY,GAAG,IAAI,CAAC;KACrB;SAAM,IAAI,GAAG,EAAE;QACd,4FAA4F;QAC5F,0DAA0D;QAC1D,WAAW,GAAG,kCAAsB,CAAC;QACrC,WAAW,GAAG,eAAG,CAAC;QAClB,YAAY,GAAG,KAAK,CAAC;KACtB;SAAM;QACL,oFAAoF;QACpF,CAAC,WAAW,EAAE,WAAW,EAAE,YAAY,CAAC,GAAG,MAAM,iBAAiB,EAAE,CAAC;KACtE;IAED,IAAI,CAAC,mBAAmB,CAAC,WAAW,CAAC,EAAE;QACrC,OAAO,CAAC,IAAI,CAAC,CAAC,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e,SAAS,oDAAoD,CAC7E,CAAC;gBACF,OAAO,KAAK,CAAC;aACd;SACF;KACF;IAED,IAAI,IAAA,qBAAa,EAAC,WAAW,CAAC,EAAE;QAC9B,OAAO,CAAC,KAAK,CACX,iIAAiI,CAClI,CAAC;QACF,OAAO,KAAK,CAAC;KACd;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.gitCommitIfChanges = exports.isGitDirty = exports.initGitRepository = exports.promptGitHubRepoOrGitRemoteURL = void 0;
|
|
30
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
31
|
+
const command_exists_1 = __importDefault(require("command-exists"));
|
|
32
|
+
const path_1 = __importDefault(require("path"));
|
|
33
|
+
const yaml_1 = __importDefault(require("yaml"));
|
|
34
|
+
const constants_1 = require("../../constants");
|
|
35
|
+
const exec_1 = require("../../exec");
|
|
36
|
+
const file = __importStar(require("../../file"));
|
|
37
|
+
const prompt_1 = require("../../prompt");
|
|
38
|
+
const utils_1 = require("../../utils");
|
|
39
|
+
const REQUIRED_GIT_MAJOR_VERSION = 2;
|
|
40
|
+
const REQUIRED_GIT_MINOR_VERSION = 30;
|
|
41
|
+
async function promptGitHubRepoOrGitRemoteURL(projectName, yes, verbose) {
|
|
42
|
+
// We do not need to prompt the user if they do not have Git installed
|
|
43
|
+
if (!command_exists_1.default.sync("git")) {
|
|
44
|
+
console.log('Git does not seem to be installed. (The "git" command is not in the path.) Skipping Git-related things.');
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
validateNewGitVersion(verbose);
|
|
48
|
+
const gitHubUsername = getGitHubUsername();
|
|
49
|
+
if (gitHubUsername !== undefined) {
|
|
50
|
+
const [exitStatus] = (0, exec_1.execShell)("gh", ["repo", "view", projectName], verbose, true);
|
|
51
|
+
const gitHubRepoExists = exitStatus === 0;
|
|
52
|
+
const url = `https://github.com/${gitHubUsername}/${projectName}`;
|
|
53
|
+
if (gitHubRepoExists) {
|
|
54
|
+
console.log(`Detected an existing GitHub repository at: ${chalk_1.default.green(url)}`);
|
|
55
|
+
const guessedRemoteURL = getGitRemoteURL(projectName, gitHubUsername);
|
|
56
|
+
if (yes) {
|
|
57
|
+
console.log(`Using a Git remote URL of: ${chalk_1.default.green(guessedRemoteURL)}`);
|
|
58
|
+
return guessedRemoteURL;
|
|
59
|
+
}
|
|
60
|
+
const shouldUseGuessedURL = await (0, prompt_1.getInputYesNo)(`Do you want to use a Git remote URL of: ${chalk_1.default.green(guessedRemoteURL)}`);
|
|
61
|
+
if (shouldUseGuessedURL) {
|
|
62
|
+
return guessedRemoteURL;
|
|
63
|
+
}
|
|
64
|
+
// Assume that since they do not want to connect this project to the existing GitHub
|
|
65
|
+
// repository, they do not want to initialize a remote Git URL at all
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
if (yes) {
|
|
69
|
+
(0, exec_1.execShell)("gh", ["repo", "create", projectName, "--public"]);
|
|
70
|
+
console.log(`Created a new GitHub repository at: ${chalk_1.default.green(url)}`);
|
|
71
|
+
return getGitRemoteURL(projectName, gitHubUsername);
|
|
72
|
+
}
|
|
73
|
+
const createNewGitHubRepo = await (0, prompt_1.getInputYesNo)(`Would you like to create a new GitHub repository at: ${chalk_1.default.green(url)}`);
|
|
74
|
+
if (createNewGitHubRepo) {
|
|
75
|
+
(0, exec_1.execShell)("gh", ["repo", "create", projectName, "--public"]);
|
|
76
|
+
console.log("Successfully created a new GitHub repository.");
|
|
77
|
+
return getGitRemoteURL(projectName, gitHubUsername);
|
|
78
|
+
}
|
|
79
|
+
// Assume that since they do not want to create a new GitHub repository, they do not want to
|
|
80
|
+
// initialize a remote Git URL at all
|
|
81
|
+
return undefined;
|
|
82
|
+
}
|
|
83
|
+
const gitRemoteURL = await (0, prompt_1.getInputString)(`Paste in the remote Git URL for your project.
|
|
84
|
+
For example, if you have an SSH key, it would be something like:
|
|
85
|
+
${chalk_1.default.green("git@github.com:Alice/green-candle.git")}
|
|
86
|
+
If you don't have an SSH key, it would be something like:
|
|
87
|
+
${chalk_1.default.green("https://github.com/Alice/green-candle.git")}
|
|
88
|
+
If you don't want to initialize a Git repository for this project, press enter to skip.
|
|
89
|
+
`);
|
|
90
|
+
return gitRemoteURL === "" ? undefined : gitRemoteURL;
|
|
91
|
+
}
|
|
92
|
+
exports.promptGitHubRepoOrGitRemoteURL = promptGitHubRepoOrGitRemoteURL;
|
|
93
|
+
function validateNewGitVersion(verbose) {
|
|
94
|
+
const [, stdout] = (0, exec_1.execShell)("git", ["--version"], verbose);
|
|
95
|
+
const outputPrefix = "git version ";
|
|
96
|
+
if (!stdout.startsWith(outputPrefix)) {
|
|
97
|
+
(0, utils_1.error)(`Failed to parse the output from the "git --version" command: ${stdout}`);
|
|
98
|
+
}
|
|
99
|
+
const gitVersionString = stdout.slice(outputPrefix.length);
|
|
100
|
+
const [majorVersion, minorVersion] = (0, utils_1.parseSemVer)(gitVersionString);
|
|
101
|
+
if (majorVersion >= REQUIRED_GIT_MAJOR_VERSION &&
|
|
102
|
+
minorVersion >= REQUIRED_GIT_MINOR_VERSION) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
console.error(`Your Git version is: ${chalk_1.default.red(gitVersionString)}`);
|
|
106
|
+
console.error(`${constants_1.PROJECT_NAME} requires a Git version of ${chalk_1.default.red(`${REQUIRED_GIT_MAJOR_VERSION}.${REQUIRED_GIT_MINOR_VERSION}.0`)} or greater.`);
|
|
107
|
+
console.error(`Please upgrade your version of Git before using ${constants_1.PROJECT_NAME}.`);
|
|
108
|
+
process.exit(1);
|
|
109
|
+
}
|
|
110
|
+
function getGitHubUsername() {
|
|
111
|
+
// If the GitHub CLI is installed, we can derive the user's GitHub username
|
|
112
|
+
if (!command_exists_1.default.sync("gh") ||
|
|
113
|
+
process.env.APPDATA === undefined ||
|
|
114
|
+
process.env.APPDATA === "") {
|
|
115
|
+
return undefined;
|
|
116
|
+
}
|
|
117
|
+
const githubCLIHostsPath = path_1.default.join(process.env.APPDATA, "GitHub CLI", "hosts.yml");
|
|
118
|
+
if (!file.exists(githubCLIHostsPath)) {
|
|
119
|
+
return undefined;
|
|
120
|
+
}
|
|
121
|
+
const configYAMLRaw = file.read(githubCLIHostsPath);
|
|
122
|
+
const configYAML = yaml_1.default.parse(configYAMLRaw);
|
|
123
|
+
const githubCom = configYAML["github.com"];
|
|
124
|
+
if (githubCom === undefined) {
|
|
125
|
+
return undefined;
|
|
126
|
+
}
|
|
127
|
+
const { user } = githubCom;
|
|
128
|
+
if (user === "") {
|
|
129
|
+
return undefined;
|
|
130
|
+
}
|
|
131
|
+
return user;
|
|
132
|
+
}
|
|
133
|
+
function getGitRemoteURL(projectName, gitHubUsername) {
|
|
134
|
+
return `git@github.com:${gitHubUsername}/${projectName}.git`;
|
|
135
|
+
}
|
|
136
|
+
function initGitRepository(projectPath, gitRemoteURL, verbose) {
|
|
137
|
+
if (!command_exists_1.default.sync("git")) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
(0, exec_1.execShell)("git", ["init"], verbose, false, projectPath);
|
|
141
|
+
(0, exec_1.execShell)("git", ["branch", "-M", "main"], verbose, false, projectPath);
|
|
142
|
+
if (isGitNameAndEmailConfigured(verbose)) {
|
|
143
|
+
(0, exec_1.execShell)("git", ["add", "--all"], verbose, false, projectPath);
|
|
144
|
+
(0, exec_1.execShell)("git", ["commit", "--message", `${constants_1.PROJECT_NAME} template`], verbose, false, projectPath);
|
|
145
|
+
}
|
|
146
|
+
if (gitRemoteURL !== undefined) {
|
|
147
|
+
(0, exec_1.execShell)("git", ["remote", "add", "origin", gitRemoteURL], verbose, false, projectPath);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
exports.initGitRepository = initGitRepository;
|
|
151
|
+
function isGitNameAndEmailConfigured(verbose) {
|
|
152
|
+
const [nameExitStatus] = (0, exec_1.execShell)("git", ["config", "--global", "user.name"], verbose, true);
|
|
153
|
+
const [emailExitStatus] = (0, exec_1.execShell)("git", ["config", "--global", "user.email"], verbose, true);
|
|
154
|
+
return nameExitStatus === 0 && emailExitStatus === 0;
|
|
155
|
+
}
|
|
156
|
+
function isGitDirty(verbose) {
|
|
157
|
+
// From: https://remarkablemark.org/blog/2017/10/12/check-git-dirty/
|
|
158
|
+
const [, stdout] = (0, exec_1.execShell)("git", ["status", "--porcelain"], verbose);
|
|
159
|
+
return stdout !== "";
|
|
160
|
+
}
|
|
161
|
+
exports.isGitDirty = isGitDirty;
|
|
162
|
+
function gitCommitIfChanges(version, verbose) {
|
|
163
|
+
// Throw an error if this is not a git repository
|
|
164
|
+
(0, exec_1.execShell)("git", ["status"], verbose);
|
|
165
|
+
if (!isGitDirty(verbose)) {
|
|
166
|
+
console.log("There are no changes to commit.");
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
const commitMessage = `v${version}`;
|
|
170
|
+
(0, exec_1.execShell)("git", ["add", "-A"], verbose);
|
|
171
|
+
(0, exec_1.execShell)("git", ["commit", "-m", commitMessage], verbose);
|
|
172
|
+
(0, exec_1.execShell)("git", ["push"], verbose);
|
|
173
|
+
console.log(`Committed and pushed to the git repository with a message of: ${commitMessage}`);
|
|
174
|
+
}
|
|
175
|
+
exports.gitCommitIfChanges = gitCommitIfChanges;
|
|
176
|
+
//# sourceMappingURL=git.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.js","sourceRoot":"","sources":["../../../../src/commands/init/git.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,oEAA2C;AAC3C,gDAAwB;AACxB,gDAAwB;AACxB,+CAA+C;AAC/C,qCAAuC;AACvC,iDAAmC;AACnC,yCAA6D;AAE7D,uCAAiD;AAEjD,MAAM,0BAA0B,GAAG,CAAC,CAAC;AACrC,MAAM,0BAA0B,GAAG,EAAE,CAAC;AAE/B,KAAK,UAAU,8BAA8B,CAClD,WAAmB,EACnB,GAAY,EACZ,OAAgB;IAEhB,sEAAsE;IACtE,IAAI,CAAC,wBAAa,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;QAC9B,OAAO,CAAC,GAAG,CACT,yGAAyG,CAC1G,CAAC;QACF,OAAO,SAAS,CAAC;KAClB;IAED,qBAAqB,CAAC,OAAO,CAAC,CAAC;IAE/B,MAAM,cAAc,GAAG,iBAAiB,EAAE,CAAC;IAC3C,IAAI,cAAc,KAAK,SAAS,EAA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