forked from vchelaru/Gum
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathZipGumScript.ps1
More file actions
21 lines (19 loc) · 859 Bytes
/
ZipGumScript.ps1
File metadata and controls
21 lines (19 loc) · 859 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Define the folder and zip file paths using TeamCity variables
$folderToZip = Join-Path -Path "%teamcity.build.checkoutDir%" -ChildPath "Gum/bin/Debug/"
$zipFilePath = Join-Path -Path "%teamcity.build.checkoutDir%" -ChildPath "Gum.zip"
# Check if the folder exists
if (Test-Path $folderToZip) {
# Attempt to zip the folder
Compress-Archive -Path "$folderToZip\*" -DestinationPath $zipFilePath
# Check if the zip file exists
if (Test-Path $zipFilePath) {
# Output the path and size of the zip file
$zipFileSize = (Get-Item $zipFilePath).Length
Write-Output "Zipping successful. File path: $zipFilePath"
Write-Output "File size: $($zipFileSize / 1MB) MB"
} else {
Write-Output "Zipping failed. File not found at $zipFilePath"
}
} else {
Write-Output "Folder not found at $folderToZip"
}