-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.ps1
33 lines (28 loc) · 1.16 KB
/
build.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
# First, run the Teal build
& tl build;
# Get source_dir and build_dir from tlconfig.lua
[string] $sourceDir = $null;
[string] $buildDir = $null;
Get-Content tlconfig.lua | ForEach-Object {
[string] $line = $_;
if ($line.Contains("source_dir")) {
# Get everything to the right of the equals sign, trim away spaces and quotes
$sourceDir = $line.Split('=')[1].Replace("`"", "").Replace("'", "").Replace(',', "").Trim();
}
if ($line.Contains("build_dir")) {
$buildDir = $line.Split('=')[1].Replace("`"", "").Replace("'", "").Replace(',', "").Trim();
}
}
# Canonicalize the paths
$sourceDir = [System.IO.Path]::Combine($PSScriptRoot, $sourceDir);
$buildDir = [System.IO.Path]::Combine($PSScriptRoot, $buildDir);
# Copy non-tl files to the output dir
Get-ChildItem $sourceDir -Recurse -File -Exclude "*.tl" | ForEach-Object {
[System.IO.FileInfo] $file = $_;
$destPath = $file.FullName.Replace($sourceDir, $buildDir);
Copy-Item $file.FullName $destPath -Force;
}
# Finally, copy stuff from the root to the root output
Copy-Item .\CHANGELOG.txt $buildDir;
Copy-Item .\LittleBuster.toc $buildDir;
Copy-Item .\LICENSE.md $buildDir;