Skip to content

Commit

Permalink
fix: skip checking git gpgSign config
Browse files Browse the repository at this point in the history
Fix the issue described at vuejs#5823 (comment)

This simplifies the logic, thus less error-prone.
The error message is still correct anyway.
  • Loading branch information
sodatea committed Sep 10, 2020
1 parent b94da37 commit d8010d9
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions packages/@vue/cli/lib/Creator.js
Expand Up @@ -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', 'test@test.com'])
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'])
Expand All @@ -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`
)
}
Expand Down

0 comments on commit d8010d9

Please sign in to comment.