|
@@ -60,22 +60,23 @@ if ($Delete) {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
-# Create symlinks
|
|
|
|
-Get-ChildItem -Path $SourceRoot -Recurse -File -Force | ForEach-Object {
|
|
|
|
- $relativePath = $_.FullName.Substring($SourceRoot.Length).TrimStart('\', '/')
|
|
|
|
- $targetFile = Join-Path $TargetRoot $relativePath
|
|
|
|
- $targetDir = Split-Path $targetFile
|
|
|
|
-
|
|
|
|
- if (-not (Test-Path $targetDir)) {
|
|
|
|
- Write-Log "Creating dir: $targetDir" 2
|
|
|
|
|
|
+if ($Stow) {
|
|
|
|
+ Get-ChildItem -Path $SourceRoot -Recurse -File -Force | ForEach-Object {
|
|
|
|
+ $relativePath = $_.FullName.Substring($SourceRoot.Length).TrimStart('\', '/')
|
|
|
|
+ $targetFile = Join-Path $TargetRoot $relativePath
|
|
|
|
+ $targetDir = Split-Path $targetFile
|
|
|
|
+
|
|
|
|
+ if (-not (Test-Path $targetDir)) {
|
|
|
|
+ Write-Log "Creating dir: $targetDir" 2
|
|
|
|
+ if (-not $Simulate) {
|
|
|
|
+ New-Item -ItemType Directory -Path $targetDir -Force | Out-Null
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Write-Log "Linking: $targetFile -> $($_.FullName)"
|
|
if (-not $Simulate) {
|
|
if (-not $Simulate) {
|
|
- New-Item -ItemType Directory -Path $targetDir -Force | Out-Null
|
|
|
|
|
|
+ New-Item -ItemType SymbolicLink -Path $targetFile -Target $_.FullName | Out-Null
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
- Write-Log "Linking: $targetFile -> $($_.FullName)"
|
|
|
|
- if (-not $Simulate) {
|
|
|
|
- New-Item -ItemType SymbolicLink -Path $targetFile -Target $_.FullName | Out-Null
|
|
|
|
- }
|
|
|
|
|
|
+ return
|
|
}
|
|
}
|
|
-
|
|
|