-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: skip checking git gpgSign config (#5869)
Fix the issue described at #5823 (comment) This simplifies the logic, thus less error-prone. The error message is still correct anyway.
- Loading branch information
1 parent
b94da37
commit 6409363
Showing
1 changed file
with
1 addition
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -259,22 +259,13 @@ module.exports = class Creator extends EventEmitter { | |
|
||
// commit initial state | ||
let gitCommitFailed = false | ||
let gpgSign = false | ||
if (shouldInitGit) { | ||
await run('git add -A') | ||
if (isTestOrDebug) { | ||
await run('git', ['config', 'user.name', 'test']) | ||
await run('git', ['config', 'user.email', '[email protected]']) | ||
await run('git', ['config', 'commit.gpgSign', 'false']) | ||
} | ||
gpgSign = await (async () => { | ||
const { stdout: gpgSignConfig } = await run('git', [ | ||
'config', | ||
'--get', | ||
'commit.gpgSign' | ||
]) | ||
return gpgSignConfig === 'true' | ||
})() | ||
const msg = typeof cliOptions.git === 'string' ? cliOptions.git : 'init' | ||
try { | ||
await run('git', ['commit', '-m', msg, '--no-verify']) | ||
|
@@ -298,7 +289,7 @@ module.exports = class Creator extends EventEmitter { | |
|
||
if (gitCommitFailed) { | ||
warn( | ||
`Skipped git commit due to missing username and email in git config${gpgSign ? ' or failed to sign commit' : ''}.\n` + | ||
`Skipped git commit due to missing username and email in git config, or failed to sign commit.\n` + | ||
`You will need to perform the initial commit yourself.\n` | ||
) | ||
} | ||
|