|
|
|
@ -78,6 +78,15 @@ try { |
|
|
|
} |
|
|
|
|
|
|
|
Write-SyncLog -Level INFO -Message "Starting sync from '$sourceRoot'." |
|
|
|
Invoke-Git -Arguments @('fetch', 'origin', 'main') |
|
|
|
$remoteAhead = [int](& git -C $repositoryRoot rev-list --count 'main..origin/main') |
|
|
|
if ($LASTEXITCODE -ne 0) { |
|
|
|
throw 'Unable to determine whether the remote branch is ahead.' |
|
|
|
} |
|
|
|
if ($remoteAhead -gt 0) { |
|
|
|
throw "Remote branch origin/main is ahead by $remoteAhead commit(s); merge it before syncing." |
|
|
|
} |
|
|
|
|
|
|
|
New-Item -ItemType Directory -Path $stagingRoot | Out-Null |
|
|
|
|
|
|
|
$sourceSkills = Get-ChildItem -LiteralPath $sourceRoot -Directory | Sort-Object Name |
|
|
|
|