Fix: replace ?? operator with compatible if/else for older PowerShell

This commit is contained in:
nvtien
2026-02-16 14:06:29 +09:00
parent 2d31c0a137
commit c03aad9066

View File

@@ -36,7 +36,8 @@ if (Test-Path $SourcesFile) {
$TmpDir = Join-Path $env:TEMP "ag-sync-$($Source.name)"
if (Test-Path $TmpDir) { Remove-Item -Recurse -Force $TmpDir }
git clone --depth 1 $Source.url $TmpDir 2>$null
$SrcPath = Join-Path $TmpDir ($Source.path ?? "skills")
$SkillPath = if ($Source.path) { $Source.path } else { "skills" }
$SrcPath = Join-Path $TmpDir $SkillPath
if (Test-Path $SrcPath) {
Get-ChildItem -Path $SrcPath -Directory | ForEach-Object {
Copy-Item -Path $_.FullName -Destination (Join-Path $Dest $_.Name) -Recurse -Force