GeezerVison is showing github.com — Merge remote-tracking branch 'origin/main' into pr-2009 · voidzero-dev/vite-plus@b68b042
File treeExpand file treeCollapse file tree Open diff view settings snap-tests/create-git-commit-fail
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: packages/cli/snap-tests-global/command-create-help/snap.txt +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -19,7 +19,7 @@ Options: | 19 | 19 | --no-agent Skip writing coding agent instructions | 20 | 20 | --editor NAME Write editor config files for the specified editor. | 21 | 21 | --no-editor Skip writing editor config files | 22 | | - --git Initialize a git repository with an initial commit | | 22 | + --git Initialize a git repository | 23 | 23 | --no-git Skip git repository initialization | 24 | 24 | --hooks Set up pre-commit hooks (default in non-interactive mode) | 25 | 25 | --no-hooks Skip pre-commit hooks setup | @@ -85,7 +85,7 @@ Options: | 85 | 85 | --no-agent Skip writing coding agent instructions | 86 | 86 | --editor NAME Write editor config files for the specified editor. | 87 | 87 | --no-editor Skip writing editor config files | 88 | | - --git Initialize a git repository with an initial commit | | 88 | + --git Initialize a git repository | 89 | 89 | --no-git Skip git repository initialization | 90 | 90 | --hooks Set up pre-commit hooks (default in non-interactive mode) | 91 | 91 | --no-hooks Skip pre-commit hooks setup | @@ -151,7 +151,7 @@ Options: | 151 | 151 | --no-agent Skip writing coding agent instructions | 152 | 152 | --editor NAME Write editor config files for the specified editor. | 153 | 153 | --no-editor Skip writing editor config files | 154 | | - --git Initialize a git repository with an initial commit | | 154 | + --git Initialize a git repository | 155 | 155 | --no-git Skip git repository initialization | 156 | 156 | --hooks Set up pre-commit hooks (default in non-interactive mode) | 157 | 157 | --no-hooks Skip pre-commit hooks setup | |
Collapse file Copy file name to clipboardExpand all lines: packages/cli/snap-tests-global/new-check/snap.txt +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -19,7 +19,7 @@ Options: | 19 | 19 | --no-agent Skip writing coding agent instructions | 20 | 20 | --editor NAME Write editor config files for the specified editor. | 21 | 21 | --no-editor Skip writing editor config files | 22 | | - --git Initialize a git repository with an initial commit | | 22 | + --git Initialize a git repository | 23 | 23 | --no-git Skip git repository initialization | 24 | 24 | --hooks Set up pre-commit hooks (default in non-interactive mode) | 25 | 25 | --no-hooks Skip pre-commit hooks setup | |
Collapse file Copy file name to clipboardExpand all lines: packages/cli/snap-tests/create-git-commit-fail/hooks/pre-commit -3Lines changed: 0 additions & 3 deletions Collapse file Copy file name to clipboardExpand all lines: packages/cli/snap-tests/create-git-commit-fail/snap.txt -11Lines changed: 0 additions & 11 deletions Collapse file Copy file name to clipboardExpand all lines: packages/cli/snap-tests/create-git-commit-fail/steps.json -11Lines changed: 0 additions & 11 deletions Collapse file Copy file name to clipboardExpand all lines: packages/cli/src/create/bin.ts +2-22Lines changed: 2 additions & 22 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -36,7 +36,7 @@ import { | 36 | 36 | resolveApproveBuildTargets, | 37 | 37 | } from '../utils/approve-builds.ts'; | 38 | 38 | import { detectExistingEditors, selectEditors, writeEditorConfigs } from '../utils/editor.ts'; | 39 | | -import { createInitialCommit, initGitRepository } from '../utils/git.ts'; | | 39 | +import { initGitRepository } from '../utils/git.ts'; | 40 | 40 | import { renderCliDoc } from '../utils/help.ts'; | 41 | 41 | import { readJsonFile } from '../utils/json.ts'; | 42 | 42 | import { displayRelative } from '../utils/path.ts'; | @@ -128,7 +128,7 @@ const helpMessage = renderCliDoc({ | 128 | 128 | description: 'Write editor config files for the specified editor.', | 129 | 129 | }, | 130 | 130 | { label: '--no-editor', description: 'Skip writing editor config files' }, | 131 | | - { label: '--git', description: 'Initialize a git repository with an initial commit' }, | | 131 | + { label: '--git', description: 'Initialize a git repository' }, | 132 | 132 | { label: '--no-git', description: 'Skip git repository initialization' }, | 133 | 133 | { | 134 | 134 | label: '--hooks', | @@ -1135,16 +1135,6 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h | 1135 | 1135 | await handleIgnoredBuilds(fullPath, fullPath, installSummary); | 1136 | 1136 | updateCreateProgress('Formatting code'); | 1137 | 1137 | await runViteFmt(fullPath, options.interactive, undefined, { silent: compactOutput }); | 1138 | | - if (shouldSetupGit) { | 1139 | | - updateCreateProgress('Creating initial commit'); | 1140 | | - const commitResult = await createInitialCommit(fullPath); | 1141 | | - if (!commitResult.success) { | 1142 | | - prompts.log.warn('Initial commit failed'); | 1143 | | - if (commitResult.output) { | 1144 | | - prompts.log.info(commitResult.output); | 1145 | | - } | 1146 | | - } | 1147 | | - } | 1148 | 1138 | clearCreateProgress(); | 1149 | 1139 | showCreateSummary({ | 1150 | 1140 | description: describeScaffold(selectedTemplateName, selectedTemplateArgs), | @@ -1459,16 +1449,6 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h | 1459 | 1449 | await handleIgnoredBuilds(fullPath, fullPath, installSummary); | 1460 | 1450 | updateCreateProgress('Formatting code'); | 1461 | 1451 | await runViteFmt(fullPath, options.interactive, undefined, { silent: compactOutput }); | 1462 | | - if (shouldSetupGit) { | 1463 | | - updateCreateProgress('Creating initial commit'); | 1464 | | - const commitResult = await createInitialCommit(fullPath); | 1465 | | - if (!commitResult.success) { | 1466 | | - prompts.log.warn('Initial commit failed'); | 1467 | | - if (commitResult.output) { | 1468 | | - prompts.log.info(commitResult.output); | 1469 | | - } | 1470 | | - } | 1471 | | - } | 1472 | 1452 | } | 1473 | 1453 |
| 1474 | 1454 | clearCreateProgress(); | |
Collapse file Copy file name to clipboardExpand all lines: packages/cli/src/utils/git.ts -25Lines changed: 0 additions & 25 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -9,28 +9,3 @@ export async function initGitRepository(cwd: string): Promise<boolean> { | 9 | 9 | }); | 10 | 10 | return result.exitCode === 0; | 11 | 11 | } | 12 | | - | 13 | | -export interface InitialCommitResult { | 14 | | - success: boolean; | 15 | | - /** Combined stdout/stderr from `git commit`, for diagnosing failures (e.g. a failing pre-commit hook). */ | 16 | | - output: string; | 17 | | -} | 18 | | - | 19 | | -export async function createInitialCommit(cwd: string): Promise<InitialCommitResult> { | 20 | | - await runCommandSilently({ | 21 | | - command: 'git', | 22 | | - args: ['add', '-A'], | 23 | | - cwd, | 24 | | - envs: process.env, | 25 | | - }); | 26 | | - const result = await runCommandSilently({ | 27 | | - command: 'git', | 28 | | - args: ['commit', '-m', 'Initial commit from Vite+'], | 29 | | - cwd, | 30 | | - envs: process.env, | 31 | | - }); | 32 | | - return { | 33 | | - success: result.exitCode === 0, | 34 | | - output: `${result.stdout.toString()}${result.stderr.toString()}`.trim(), | 35 | | - }; | 36 | | -} |
Collapse file Copy file name to clipboardExpand all lines: packages/cli/src/utils/prompts.ts +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -260,7 +260,7 @@ export async function promptGitInit(options: { | 260 | 260 | } | 261 | 261 | if (options.interactive) { | 262 | 262 | const selected = await prompts.confirm({ | 263 | | - message: 'Initialize a git repository with an initial commit?', | | 263 | + message: 'Initialize a git repository?', | 264 | 264 | initialValue: true, | 265 | 265 | }); | 266 | 266 | if (prompts.isCancel(selected)) { | |
|