mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-26 09:21:51 +08:00
ci: checkout existing branch on snapshots
This commit is contained in:
parent
bf228a064c
commit
b360206b31
@ -91,7 +91,12 @@ async function _publishSnapshot(
|
|||||||
|
|
||||||
_exec('git', ['clone', url], { cwd: root }, publishLogger);
|
_exec('git', ['clone', url], { cwd: root }, publishLogger);
|
||||||
if (branch) {
|
if (branch) {
|
||||||
_exec('git', ['checkout', '-B', branch], { cwd: destPath }, publishLogger);
|
// Try to checkout an existing branch, otherwise create it.
|
||||||
|
try {
|
||||||
|
_exec('git', ['checkout', branch], { cwd: destPath }, publishLogger);
|
||||||
|
} catch {
|
||||||
|
_exec('git', ['checkout', '-b', branch], { cwd: destPath }, publishLogger);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear snapshot directory before publishing to remove deleted build files.
|
// Clear snapshot directory before publishing to remove deleted build files.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user