mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 14:07:46 +08:00
added file exist check and null check
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
$ConfigurationName
|
$ConfigurationName
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Write-Output ""
|
||||||
Write-Output "===== Beginning $($PSCmdlet.MyInvocation.MyCommand) ====="
|
Write-Output "===== Beginning $($PSCmdlet.MyInvocation.MyCommand) ====="
|
||||||
|
|
||||||
$ConfigurationName = $ConfigurationName.Trim()
|
$ConfigurationName = $ConfigurationName.Trim()
|
||||||
@@ -46,8 +47,13 @@ if ($ConfigurationName -match "Release") {
|
|||||||
}
|
}
|
||||||
# Local build
|
# Local build
|
||||||
else {
|
else {
|
||||||
$outputZipPath = "$($SolutionDir)Release\$zipFilePrefix-$($version).zip"
|
if (!(Test-Path -Path $debugFile -PathType Leaf))
|
||||||
Compress-Archive $debugFile $outputZipPath -Force
|
{
|
||||||
|
$outputZipPath = "$($SolutionDir)Release\$zipFilePrefix-$($version).zip"
|
||||||
|
Compress-Archive $debugFile $outputZipPath -Force
|
||||||
|
} else {
|
||||||
|
write-host "File do not exist:" $debugFile", nothing to compress"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Remove-Item $debugFile
|
Remove-Item $debugFile
|
||||||
@@ -64,8 +70,13 @@ if ($ConfigurationName -eq "Release Portable") {
|
|||||||
}
|
}
|
||||||
# Local build
|
# Local build
|
||||||
else {
|
else {
|
||||||
$outputZipPath="$($SolutionDir)\Release\mRemoteNG-Portable-$($version).zip"
|
if ($Source)
|
||||||
Compress-Archive $Source $outputZipPath -Force
|
{
|
||||||
|
$outputZipPath="$($SolutionDir)\Release\mRemoteNG-Portable-$($version).zip"
|
||||||
|
Compress-Archive $Source $outputZipPath -Force
|
||||||
|
} else {
|
||||||
|
write-host "File do not exist:" $Source", nothing to compress"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user