chore: add pre cleaning for .ps1 installation script
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
dbc4806cf9
commit
79dff4af73
1 changed files with 14 additions and 1 deletions
|
|
@ -148,8 +148,21 @@ function Get-UnixSystemLayout {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$tempInstallRoot = "/tmp/picoclaw-$([DateTimeOffset]::UtcNow.ToUnixTimeSeconds())"
|
||||||
|
|
||||||
|
try {
|
||||||
|
Get-ChildItem -Path '/tmp' -Filter 'picoclaw-*' -Directory -ErrorAction SilentlyContinue |
|
||||||
|
ForEach-Object {
|
||||||
|
if ($_.FullName -ne $tempInstallRoot) {
|
||||||
|
Remove-Item -LiteralPath $_.FullName -Recurse -Force -ErrorAction SilentlyContinue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
# Best-effort cleanup; ignore any failures to avoid breaking installation.
|
||||||
|
}
|
||||||
|
|
||||||
return @{
|
return @{
|
||||||
installRoot = "/tmp/picoclaw-$([DateTimeOffset]::UtcNow.ToUnixTimeSeconds())"
|
installRoot = $tempInstallRoot
|
||||||
linkDir = '/usr/bin'
|
linkDir = '/usr/bin'
|
||||||
mode = 'copy-executables'
|
mode = 'copy-executables'
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue