1
0
mirror of https://github.com/angular/angular-cli.git synced 2025-05-17 02:54:21 +08:00

build: trim SHA used for snapshot tags

This should fix

```
fatal: 'c22bda9
' is not a valid tag name.
Command failed: git "tag", "c22bda9\n"
file:///home/runner/work/angular-cli/angular-cli/scripts/devkit-admin.mts:39
        console.error(err.stack);
```
This commit is contained in:
Alan Agius 2024-03-14 15:22:01 +00:00 committed by Alan Agius
parent c22bda930a
commit 846d63c071

@ -125,7 +125,7 @@ async function _publishSnapshot(
fs.writeFileSync(path.join(destPath, 'uniqueId'), '' + new Date());
// Ensure we call git from within this repo
gitShaCache ??= _exec('git', ['log', '--format=%h', '-n1'], { cwd: __dirname });
gitShaCache ??= _exec('git', ['log', '--format=%h', '-n1'], { cwd: __dirname }).trim();
// Commit and push.
_exec('git', ['add', '.'], { cwd: destPath });