install: rewrite caddyfile if not exist

This commit is contained in:
undefined committed 2024-10-08 20:17:55 +08:00
1 parent 5f8785362c
commit 35e481213d
1 file changed
+3 -2
+3 -2
View File
@@ -305,7 +305,7 @@ const Steps = () => [
{ {
init: 'install.preparing', init: 'install.preparing',
operations: [ operations: [
() => { async () => {
if (process.env.IGNORE_BT) return; if (process.env.IGNORE_BT) return;
const res = exec('bt default'); const res = exec('bt default');
if (!res.code) { if (!res.code) {
@@ -314,6 +314,7 @@ const Steps = () => [
process.exit(1); process.exit(1);
} else { } else {
log.warn('warn.bt'); log.warn('warn.bt');
await sleep(5000);
} }
} }
}, },
@@ -407,7 +408,7 @@ ${nixConfBase}`);
}, },
{ {
init: 'install.caddy', init: 'install.caddy',
skip: () => !exec('caddy version').code || installAsJudge || noCaddy, skip: () => !exec('caddy version').code || installAsJudge || noCaddy || !existsSync(`${process.env.HOME}/.hydro/Caddyfile`),
hidden: installAsJudge, hidden: installAsJudge,
operations: [ operations: [
'nix-env -iA nixpkgs.caddy', 'nix-env -iA nixpkgs.caddy',