forked from mRemoteNG/mRemoteNG
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tidy_files_for_release.ps1
39 lines (33 loc) · 1.01 KB
/
tidy_files_for_release.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
param (
[string]
[Parameter(Mandatory=$true)]
$TargetDir,
[string]
[Parameter(Mandatory=$true)]
$ConfigurationName
)
Write-Output "===== Beginning $($PSCmdlet.MyInvocation.MyCommand) ====="
# Remove unnecessary files from Release versions
if ($ConfigurationName -match "Release") {
Write-Output "Removing unnecessary files from Release versions"
$test = Join-Path -Path $TargetDir -ChildPath "app.publish"
if (Test-Path $test -PathType Container) {
Remove-Item -Path (Join-Path -Path $TargetDir -ChildPath "app.publish") -Recurse -Force
}
$filesToDelete = Get-ChildItem -Path $TargetDir -Recurse -Include @(
"*.publish",
"*.xml",
"*.backup",
"*.log",
"*vshost*",
"*.tmp"
) -Exclude @(
"mRemoteNG.VisualElementsManifest.xml"
)
Remove-Item -Path $filesToDelete.FullName
Write-Output $filesToDelete.FullName
}
else {
Write-Output "We will not remove anything - this is not a release build."
}
Write-Output ""