gridsum-vue3-pc 1.0.3 → 1.0.5

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.
@@ -134,17 +134,6 @@ function getInstallCommand(pkgManager) {
134
134
  return args;
135
135
  }
136
136
 
137
- function getRunCommand(pkgManager, script) {
138
- switch (pkgManager) {
139
- case 'yarn':
140
- case 'pnpm':
141
- case 'bun':
142
- return [pkgManager, script];
143
- default:
144
- return [pkgManager, 'run', script];
145
- }
146
- }
147
-
148
137
  function runCommand(command, options = {}) {
149
138
  const [cmd, ...args] = command;
150
139
  const result = spawn.sync(cmd, args, {
@@ -202,6 +191,8 @@ function runCommandAsync(command, options = {}) {
202
191
 
203
192
  function tryGitInit(root) {
204
193
  try {
194
+ const hasGit = spawn.sync('git', ['--version'], { stdio: 'ignore' });
195
+ if (hasGit.status !== 0) return;
205
196
  spawn.sync('git', ['init'], { cwd: root, stdio: 'ignore' });
206
197
  spawn.sync('git', ['add', '.'], { cwd: root, stdio: 'ignore' });
207
198
  spawn.sync('git', ['-c', 'user.name=gridsum-vue3-pc', '-c', 'user.email=gridsum-vue3-pc@local', 'commit', '-m', 'Initial project scaffolded by gridsum-vue3-pc'], {
@@ -491,26 +482,6 @@ async function main() {
491
482
  tryGitInit(root);
492
483
  }
493
484
 
494
- let autoStart = argv['auto-start'];
495
- if (autoStart === undefined && isInteractive) {
496
- const result = await prompts.confirm({
497
- message: 'Start dev server now?',
498
- initialValue: false,
499
- });
500
- if (prompts.isCancel(result)) return cancel();
501
- autoStart = result;
502
- }
503
-
504
- if (autoStart) {
505
- prompts.log.step(`Starting dev server... (press ${pc.bold('Ctrl+C')} to stop)`);
506
- if (process.env._CREATE_VUE3_PC_TEST) {
507
- prompts.log.info('Dev server started (skipped in test)');
508
- } else {
509
- runCommand(getRunCommand(pkgManager, 'dev'), { cwd: root });
510
- return;
511
- }
512
- }
513
-
514
485
  const cdProjectName = path.relative(process.cwd(), root);
515
486
  let doneMessage = '';
516
487
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gridsum-vue3-pc",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Gridsum Vue3 Vite PC Template Generator - 快速生成基于 Vue3 + Vite + TypeScript 的企业级 PC 端项目",
5
5
  "type": "module",
6
6
  "sideEffects": false,