Skip to content

Commit

Permalink
Check user name and email before git commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
sfdctaka committed Jun 18, 2023
1 parent 77e1383 commit f4d7ca0
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions src/test/suite/commands/configureProjectCommand.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,32 @@ suite('Configure Project Command Test Suite', () => {
await CommonUtils.executeCommandAsync('git init');
await writeFile(path.join(process.cwd(), 'README.txt'), 'Some content');
await CommonUtils.executeCommandAsync('git add README.txt');
await CommonUtils.executeCommandAsync(
'git config --global user.email "[email protected]"'

const emailResult = await CommonUtils.executeCommandAsync(
//'git config --global user.email "[email protected]"'
'git config --global user.email'
);
await CommonUtils.executeCommandAsync(
'git config --global user.name "Your Name"'
if (emailResult.stderr !== '') {
console.error('fff');
await CommonUtils.executeCommandAsync(
'git config --global user.email "[email protected]'
);
}

const nameResult = await CommonUtils.executeCommandAsync(
'git config --global user.name'
);
if (nameResult.stderr !== '') {
console.error('ggg');
await CommonUtils.executeCommandAsync(
'git config --global user.name "Your Name"'
);
}

await CommonUtils.executeCommandAsync(
'git commit --no-gpg-sign -m "Initial commit"'
);

process.chdir(origCwd);

try {
Expand Down

0 comments on commit f4d7ca0

Please sign in to comment.