Skip to content

Commit 964bac1

Browse files
committed
💚 Fix cross-platform artifact cleanup
1 parent fa3f57e commit 964bac1

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Build/build-functions.psm1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ $reportGenerator = Join-Path $toolsDir $reportGeneratorName
1111
function Remove-ArtifactsDir {
1212
if (Test-Path $artifactsDir) {
1313
write-host -foreground blue "Clean up...`n"
14-
rm $artifactsDir -Recurse -Force -ErrorAction Stop
14+
Remove-Item -LiteralPath $artifactsDir -Recurse -Force -ErrorAction Stop
1515
write-host -foreground blue "Clean up...END`n"
1616
}
1717
}
@@ -127,14 +127,14 @@ function Compress-ArtifactsAsZip {
127127
$tempZipFile = Join-Path $root $zipFileName
128128
$zipFile = Join-Path $artifactsDir $zipFileName
129129

130-
rm $tempZipFile -ErrorAction Ignore
131-
rm $zipFile -ErrorAction Ignore
130+
Remove-Item -LiteralPath $tempZipFile -ErrorAction Ignore
131+
Remove-Item -LiteralPath $zipFile -ErrorAction Ignore
132132

133133
# Create zip file
134134
add-type -assembly "system.io.compression.filesystem"
135135
[IO.Compression.ZipFile]::CreateFromDirectory($artifactsDir, $tempZipFile)
136136

137-
mv $tempZipFile $zipFile
137+
Move-Item -LiteralPath $tempZipFile -Destination $zipFile
138138
if (-not $?) { write-host -foreground red "Failed to move [$tempZipFile] to [$zipFileName]."; exit 1 }
139139

140140
write-host -foreground blue "Zip artifacts...END`n"

0 commit comments

Comments
 (0)