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
|
||||
)
|
||||
|
||||
Write-Output ""
|
||||
Write-Output "===== Beginning $($PSCmdlet.MyInvocation.MyCommand) ====="
|
||||
|
||||
$ConfigurationName = $ConfigurationName.Trim()
|
||||
@@ -46,8 +47,13 @@ if ($ConfigurationName -match "Release") {
|
||||
}
|
||||
# Local build
|
||||
else {
|
||||
if (!(Test-Path -Path $debugFile -PathType Leaf))
|
||||
{
|
||||
$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
|
||||
@@ -64,8 +70,13 @@ if ($ConfigurationName -eq "Release Portable") {
|
||||
}
|
||||
# Local build
|
||||
else {
|
||||
if ($Source)
|
||||
{
|
||||
$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