diff --git a/Tools/tidy_files_for_release.ps1 b/Tools/tidy_files_for_release.ps1 index 1d6d84597..fc8fdb651 100644 --- a/Tools/tidy_files_for_release.ps1 +++ b/Tools/tidy_files_for_release.ps1 @@ -7,15 +7,15 @@ param ( [Parameter(Mandatory=$true)] $ConfigurationName ) - +Write-Output "" Write-Output "===== Beginning $($PSCmdlet.MyInvocation.MyCommand) =====" # Remove unnecessary files from Release versions -if ($ConfigurationName -match "Release") { - Write-Output "Removing unnecessary files from Release versions" - +if ($ConfigurationName -match "Release") +{ $test = Join-Path -Path $TargetDir -ChildPath "app.publish" - if (Test-Path $test -PathType Container) { + if (Test-Path $test -PathType Container) + { Remove-Item -Path (Join-Path -Path $TargetDir -ChildPath "app.publish") -Recurse -Force } @@ -29,10 +29,18 @@ if ($ConfigurationName -match "Release") { ) -Exclude @( "mRemoteNG.VisualElementsManifest.xml" ) - Remove-Item -Path $filesToDelete.FullName - Write-Output $filesToDelete.FullName + if ($filesToDelete) + { + Write-Output "Unnecessary files are detected and will be removed" + Remove-Item -Path $filesToDelete.FullName + Write-Output $filesToDelete.FullName + } else + { + Write-Output " No unnecessary files are detected" + } } -else { +else +{ Write-Output "We will not remove anything - this is not a release build." }