Skripte plattformunabhängig in Node.js statt Bash
This commit is contained in:
1 parent
7e64f85836
commit
712acdf2e5
12 files changed
+273
-172
No files matched your search
@@ -0,0 +1,21 @@
|
||||
// Stoppt das lokale Forgejo. Mit --purge werden Container, Daten-Volume, Token und Git-Remote gelöscht.
|
||||
import fs from "node:fs";
|
||||
import {
|
||||
STATE_DIR, FORGEJO_CONTAINER, FORGEJO_VOLUME, GIT_REMOTE, log, run, containerEngine, main,
|
||||
} from "./lib.mjs";
|
||||
|
||||
main(async () => {
|
||||
const engine = containerEngine();
|
||||
const quiet = { capture: true, allowFail: true };
|
||||
|
||||
run(engine, ["stop", FORGEJO_CONTAINER], quiet);
|
||||
if (process.argv.includes("--purge")) {
|
||||
run(engine, ["rm", "-f", FORGEJO_CONTAINER], quiet);
|
||||
run(engine, ["volume", "rm", "-f", FORGEJO_VOLUME], quiet);
|
||||
fs.rmSync(STATE_DIR, { recursive: true, force: true });
|
||||
run("git", ["remote", "remove", GIT_REMOTE], quiet);
|
||||
log("Forgejo inkl. Daten entfernt");
|
||||
} else {
|
||||
log("Forgejo gestoppt (Daten bleiben erhalten; --purge zum Löschen)");
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user