Hilfsskripte in PowerShell statt Node.js
This commit is contained in:
1 parent
c8014d6f5e
commit
302faa395c
12 files changed
+311
-288
No files matched your search
@@ -0,0 +1,17 @@
|
||||
# Stoppt das lokale Forgejo. Mit -Purge werden Container, Daten-Volume, Token und Git-Remote gelöscht.
|
||||
param([switch]$Purge)
|
||||
. "$PSScriptRoot\lib.ps1"
|
||||
|
||||
Invoke-Main {
|
||||
$engine = Get-ContainerEngine
|
||||
Invoke-Native $engine @('stop', $ForgejoContainer) -Capture -AllowFail | Out-Null
|
||||
if ($Purge) {
|
||||
Invoke-Native $engine @('rm', '-f', $ForgejoContainer) -Capture -AllowFail | Out-Null
|
||||
Invoke-Native $engine @('volume', 'rm', '-f', $ForgejoVolume) -Capture -AllowFail | Out-Null
|
||||
if (Test-Path $StateDir) { Remove-Item -Recurse -Force $StateDir }
|
||||
Invoke-Native 'git' @('remote', 'remove', $GitRemote) -Capture -AllowFail | Out-Null
|
||||
Write-Step 'Forgejo inkl. Daten entfernt'
|
||||
} else {
|
||||
Write-Step 'Forgejo gestoppt (Daten bleiben erhalten; -Purge zum Löschen)'
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user