-
Notifications
You must be signed in to change notification settings - Fork 2
/
generate-ctan.ps1
40 lines (32 loc) · 931 Bytes
/
generate-ctan.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
40
#
# Generate a zip file suitable for uploading to CTAN.
#
# This script relies on the TDS directory having been made.
#
param(
[Switch]$ExcludeTds = $false,
[Switch]$RemoveOut = $false
)
$in = "tdsout"
$out = "ctanout"
# We need the following files in the zip for ctan:
# - The class files
# - The style files
# - The docs (including the pdf versions)
# - The logos
# - The readme
# First, create the output directory
New-Item -ItemType Directory -Force -Path $out/ugent2016
Get-ChildItem $in -Recurse -File -Depth 3 | ForEach-Object {
$filename = "$($_.BaseName)$($_.Extension)"
Write-Host $_.FullName
Copy-Item $_.FullName -Destination $out/ugent2016/$filename
}
# Add tds-compliant zip file if necessary
if (!$ExcludeTds) {
Copy-Item ugent2016.tds.zip -Destination $out
}
Compress-Archive -Path $out/* -DestinationPath ugent2016.zip -Force
if ($RemoveOut) {
Remove-Item $out -Recurse -Force
}