Skip to content

Commit aa000eb

Browse files
committed
build: publish script should not print error if tag does not exist
Currently the publish script prints an error if the release tag does not exist locally yet. This is not expected since the function that calls `git` to check if a given tag exists, returns a boolean and should not additionally print the git `stderr`.
1 parent bc6b700 commit aa000eb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/release/git/git-client.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ export class GitClient {
1414
* Spawns a child process running Git. The "stderr" output is inherited and will be printed
1515
* in case of errors. This makes it easier to debug failed commands.
1616
*/
17-
private _spawnGitProcess(args: string[]): SpawnSyncReturns<string> {
17+
private _spawnGitProcess(args: string[], printStderr = true): SpawnSyncReturns<string> {
1818
return spawnSync('git', args, {
1919
cwd: this.projectDir,
20-
stdio: ['pipe', 'pipe', 'inherit'],
20+
stdio: ['pipe', 'pipe', printStderr ? 'inherit' : 'pipe'],
2121
encoding: 'utf8',
2222
});
2323
}
@@ -76,7 +76,7 @@ export class GitClient {
7676

7777
/** Checks whether the specified tag exists locally. */
7878
hasLocalTag(tagName: string) {
79-
return this._spawnGitProcess(['rev-parse', `refs/tags/${tagName}`]).status === 0;
79+
return this._spawnGitProcess(['rev-parse', `refs/tags/${tagName}`], false).status === 0;
8080
}
8181

8282
/** Gets the Git SHA of the specified local tag. */

0 commit comments

Comments
 (0)