-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake_source_zip.ps1
More file actions
39 lines (30 loc) · 995 Bytes
/
Copy pathmake_source_zip.ps1
File metadata and controls
39 lines (30 loc) · 995 Bytes
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
$ErrorActionPreference = "Stop"
$root = Split-Path -Parent $MyInvocation.MyCommand.Path
$zip = Join-Path $root "CTCLRC-source.zip"
$staging = Join-Path $root "_source_zip"
if (Test-Path -LiteralPath $staging) {
Remove-Item -LiteralPath $staging -Recurse -Force
}
New-Item -ItemType Directory -Path $staging | Out-Null
$files = @(
"README.md",
"align.py",
"lrc_export.py",
"main.py",
"ui.py",
"requirements.txt",
"CTCLRC.spec",
"make_source_zip.ps1"
)
foreach ($file in $files) {
Copy-Item -LiteralPath (Join-Path $root $file) -Destination $staging
}
if (Test-Path -LiteralPath (Join-Path $root "assets")) {
Copy-Item -LiteralPath (Join-Path $root "assets") -Destination (Join-Path $staging "assets") -Recurse
}
if (Test-Path -LiteralPath $zip) {
Remove-Item -LiteralPath $zip -Force
}
Compress-Archive -Path (Join-Path $staging "*") -DestinationPath $zip -Force
Remove-Item -LiteralPath $staging -Recurse -Force
Write-Host "Created $zip"