@4399ywkf/cli 2.0.9 → 2.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +13 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -147,6 +147,7 @@ var index = async ({
147
147
  initialValue: ERegistry.npm
148
148
  });
149
149
  };
150
+ let shouldInitGitPrompt = false;
150
151
  const selectMicroFrontend = async () => {
151
152
  const enableMicro = await confirm({
152
153
  message: "\u662F\u5426\u542F\u7528\u5FAE\u524D\u7AEF\uFF08Garfish\uFF09\uFF1F",
@@ -171,6 +172,16 @@ var index = async ({
171
172
  exitPrompt();
172
173
  }
173
174
  };
175
+ const selectGitInit = async () => {
176
+ const initGitAnswer = await confirm({
177
+ message: "\u662F\u5426\u521D\u59CB\u5316 Git \u4ED3\u5E93\uFF1F",
178
+ initialValue: false
179
+ });
180
+ if (isCancel(initGitAnswer)) {
181
+ exitPrompt();
182
+ }
183
+ shouldInitGitPrompt = !!initGitAnswer;
184
+ };
174
185
  const selectGitTemplate = async () => {
175
186
  const gitTemplate2 = await text({
176
187
  message: "\u8BF7\u8F93\u5165 Git \u6A21\u677F\u540D\u79F0",
@@ -229,6 +240,7 @@ var index = async ({
229
240
  exitPrompt();
230
241
  }
231
242
  await selectMicroFrontend();
243
+ await selectGitInit();
232
244
  outro(utils.chalk.green(`\u2728 \u4E00\u5207\u5C31\u7EEA, \u5F00\u59CB\u521B\u5EFA\u9879\u76EE...`));
233
245
  };
234
246
  const useDefaultData = !!args.default;
@@ -295,7 +307,7 @@ Git\u6A21\u677F: ${gitTemplate}
295
307
  const monorepoRoot = await detectMonorepoRoot({ target });
296
308
  const inMonorepo = !!monorepoRoot;
297
309
  const projectRoot = inMonorepo ? monorepoRoot : target;
298
- const shouldInitGit = args.git !== false;
310
+ const shouldInitGit = args.git === true || shouldInitGitPrompt;
299
311
  const withHusky = shouldInitGit && !inMonorepo;
300
312
  let pnpmExtraNpmrc = "";
301
313
  const isPnpm = npmClient === "pnpm" /* pnpm */;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@4399ywkf/cli",
3
- "version": "2.0.9",
3
+ "version": "2.0.10",
4
4
  "description": "运维开发部脚手架",
5
5
  "main": "dist/index.js",
6
6
  "bin": {