Skip to content

Commit

Permalink
fount background
Browse files Browse the repository at this point in the history
  • Loading branch information
steve02081504 committed Jan 28, 2025
1 parent c9e7d5d commit 4837ecd
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
15 changes: 15 additions & 0 deletions path/fount.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
$FOUNT_DIR = Split-Path -Parent $PSScriptRoot

if ($args.Count -gt 0 -and $args[0] -eq 'background') {
if (!(Get-Command ps12exe -ErrorAction Ignore)) {
Install-Module -Name ps12exe -Scope CurrentUser -Force
}
$TempDir = [System.IO.Path]::GetTempPath()
$exepath = Join-Path $TempDir "fount-background.exe"
if (!(Test-Path $exepath)) {
ps12exe -inputFile "$FOUNT_DIR/src/runner/background.ps1" -outputFile $exepath
}
$runargs = $args[1..$args.Count]
Start-Process -FilePath $exepath -ArgumentList $runargs
exit
}

$ErrorCount = $Error.Count

# Docker 检测
Expand Down
11 changes: 11 additions & 0 deletions src/runner/background.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!pwsh
#_pragma icon $PSScriptRoot/../public/favicon.ico
#_pragma title "fount background"
#_pragma Console 0

if (Get-Command fount.ps1 -ErrorAction Ignore) {
fount @args *>&1 | Out-Null
}
else {
"this exe requires fount installed"
}

0 comments on commit 4837ecd

Please sign in to comment.