Skip to content

Commit

Permalink
fix(snapshot): ensure git author is known when commiting
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-bompart committed Jan 5, 2024
1 parent 0129dd4 commit 39e56ff
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ describe('ExpandedPreviewer', () => {
expect(mockedSpawnProcess).toHaveBeenNthCalledWith(
2,
'git',
['add', '.'],
['config', 'user.email', '"[email protected]"'],
{
cwd: previewPath,
stdio: 'ignore',
Expand All @@ -285,7 +285,25 @@ describe('ExpandedPreviewer', () => {
expect(mockedSpawnProcess).toHaveBeenNthCalledWith(
3,
'git',
['commit', '--message=someorg currently'],
['config', 'user.name', '"Coveo CLI"'],
{
cwd: previewPath,
stdio: 'ignore',
}
);
expect(mockedSpawnProcess).toHaveBeenNthCalledWith(
4,
'git',
['add', '.'],
{
cwd: previewPath,
stdio: 'ignore',
}
);
expect(mockedSpawnProcess).toHaveBeenNthCalledWith(
5,
'git',
['commit', '--message="someorg currently"'],
{
cwd: previewPath,
stdio: 'ignore',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,14 @@ export class ExpandedPreviewer {

private async initialPreviewCommit(dirPath: string) {
await spawnProcess('git', ['init'], {cwd: dirPath, stdio: 'ignore'});
await spawnProcess('git', ['config', 'user.email', '[email protected]'], {
cwd: dirPath,
stdio: 'ignore',
});
await spawnProcess('git', ['config', 'user.name', 'Coveo CLI'], {
cwd: dirPath,
stdio: 'ignore',
});
await spawnProcess('git', ['add', '.'], {cwd: dirPath, stdio: 'ignore'});
await spawnProcess('git', ['commit', `--message=${this.orgId} currently`], {
cwd: dirPath,
Expand Down

0 comments on commit 39e56ff

Please sign in to comment.