Package portable grid agent operation (#134)
This commit is contained in:
15
packaging/metacrate-grid-agent/install.ps1
Normal file
15
packaging/metacrate-grid-agent/install.ps1
Normal file
@@ -0,0 +1,15 @@
|
||||
param(
|
||||
[Parameter(Mandatory = $true)][string]$BuiltBinary,
|
||||
[Parameter(Mandatory = $true)][string]$DestinationDirectory
|
||||
)
|
||||
$ErrorActionPreference = "Stop"
|
||||
if (-not (Test-Path -LiteralPath $BuiltBinary -PathType Leaf)) {
|
||||
throw "BuiltBinary is not a regular file"
|
||||
}
|
||||
New-Item -ItemType Directory -Force -Path $DestinationDirectory | Out-Null
|
||||
$temporary = Join-Path $DestinationDirectory ".metacrate-grid-agent.new.exe"
|
||||
Copy-Item -LiteralPath $BuiltBinary -Destination $temporary -Force
|
||||
Move-Item -LiteralPath $temporary -Destination (Join-Path $DestinationDirectory "metacrate-grid-agent.exe") -Force
|
||||
|
||||
# Configuration, secrets, conversations, landmarks, and journals live outside
|
||||
# this directory and are deliberately never created, replaced, or removed.
|
||||
Reference in New Issue
Block a user