listpage_cli 0.0.187 → 0.0.188
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/bin/cli.js
CHANGED
|
@@ -6,12 +6,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
|
-
const child_process_1 = require("child_process");
|
|
10
9
|
const enquirer_1 = require("enquirer");
|
|
11
10
|
function printHelp() {
|
|
12
11
|
const h = [
|
|
13
|
-
"
|
|
14
|
-
"
|
|
12
|
+
"用法: listpage_cli init",
|
|
13
|
+
"说明: 进入中文引导式交互,按提示填写即可",
|
|
15
14
|
].join("\n");
|
|
16
15
|
console.log(h);
|
|
17
16
|
}
|
|
@@ -117,14 +116,6 @@ function readJsonWithComments(str) {
|
|
|
117
116
|
const noTrailingComma = noLine.replace(/,\s*([}\]])/g, "$1");
|
|
118
117
|
return JSON.parse(noTrailingComma);
|
|
119
118
|
}
|
|
120
|
-
function initGit(targetDir) {
|
|
121
|
-
try {
|
|
122
|
-
(0, child_process_1.execSync)("git init", { stdio: "inherit", cwd: targetDir });
|
|
123
|
-
(0, child_process_1.execSync)("git add -A", { stdio: "inherit", cwd: targetDir });
|
|
124
|
-
(0, child_process_1.execSync)('git commit -m "init"', { stdio: "inherit", cwd: targetDir });
|
|
125
|
-
}
|
|
126
|
-
catch { }
|
|
127
|
-
}
|
|
128
119
|
async function initRush(targetDir, projectName) {
|
|
129
120
|
copyRushSkeleton(targetDir);
|
|
130
121
|
const cfgPath = path_1.default.join(targetDir, "rush.json");
|
|
@@ -151,7 +142,6 @@ async function initRush(targetDir, projectName) {
|
|
|
151
142
|
}
|
|
152
143
|
rushCfg.projects = projects;
|
|
153
144
|
fs_1.default.writeFileSync(cfgPath, JSON.stringify(rushCfg, null, 2));
|
|
154
|
-
initGit(targetDir);
|
|
155
145
|
if (fs_1.default.existsSync(path_1.default.join(targetDir, "common"))) {
|
|
156
146
|
console.log("Skipping rush update in CLI; install manually if needed.");
|
|
157
147
|
}
|
package/package.json
CHANGED