-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(snapshot): ensure git author is known when commiting
- Loading branch information
1 parent
0129dd4
commit 39e56ff
Showing
2 changed files
with
28 additions
and
2 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 |
---|---|---|
|
@@ -276,7 +276,7 @@ describe('ExpandedPreviewer', () => { | |
expect(mockedSpawnProcess).toHaveBeenNthCalledWith( | ||
2, | ||
'git', | ||
['add', '.'], | ||
['config', 'user.email', '"[email protected]"'], | ||
{ | ||
cwd: previewPath, | ||
stdio: 'ignore', | ||
|
@@ -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', | ||
|
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 |
---|---|---|
|
@@ -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, | ||
|