From 67c65c4f1bcdcfce77583878014b70d60d55c20d Mon Sep 17 00:00:00 2001 From: videogame hacker Date: Thu, 16 Nov 2023 04:37:00 +0000 Subject: [PATCH] Make ngx script only write the config if run directly --- bio-char-lt.ngx.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bio-char-lt.ngx.ts b/bio-char-lt.ngx.ts index c4c7b88..d88ae22 100644 --- a/bio-char-lt.ngx.ts +++ b/bio-char-lt.ngx.ts @@ -2,11 +2,15 @@ import ngx from "https://char.lt/ngx/ngx.ts?v=1"; -ngx("server", [ +export const site = ngx("server", [ [ "server_name bio.char.lt", ...ngx.listen(), ...ngx.letsEncrypt("bio.char.lt"), ], ngx("location /", ["root /srv/http/bio.char.lt/public"]), -]).write("/etc/nginx/http.d/bio-char-lt.conf"); +]); + +if (import.meta.main) { + site.write("/etc/nginx/http.d/bio-char-lt.conf"); +}