-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.ps1
More file actions
37 lines (28 loc) · 1 KB
/
action.ps1
File metadata and controls
37 lines (28 loc) · 1 KB
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
#!/usr/bin/env pwsh
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[string] $StagingPath
)
# check if there are any cat/gst files to process, otherwise short-circuit out
if ((Get-ChildItem -Recurse -Include *.cat, *.gst -File).Length -eq 0) {
Write-Host "No datafiles to process." -ForegroundColor Green
exit 0
}
$null = New-Item $stagingPath -ItemType Directory -ErrorAction:Ignore
function PrintAndInvoke{
param($command)
Write-Host $command -ForegroundColor Cyan
Invoke-Expression $command
}
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1
$env:DOTNET_NOLOGO = 1
# install wham if necessary
$wham = "$PSScriptRoot/lib/wham"
if ($null -eq (Get-Command $wham -ErrorAction SilentlyContinue)) {
PrintAndInvoke "dotnet tool install wham --version 0.13.0 --tool-path ""$PSScriptRoot/lib"""
}
# TODO sometime in future "wham build/ci"
# Publish snapshot to staging path
PrintAndInvoke "$wham publish -f snapshot -o ""$StagingPath"" --verbosity detailed"
Write-Host "Done" -ForegroundColor Green