0
Fork 0

rename setup dir

This commit is contained in:
Pavocracy 2024-02-03 11:41:32 +10:00
parent 76f56f2c7e
commit 256bd56c62
Signed by: Pavocracy
GPG Key ID: 4669764A8BBA94F9
1 changed files with 6 additions and 6 deletions

View File

@ -6,7 +6,7 @@
import { $ } from "bun"
import { sys } from "typescript"
const src_dir = import.meta.dir
const root_dir = import.meta.dir
console.log("Starting setup process...")
@ -18,19 +18,19 @@ if (sys.args.includes("--production")) {
}
console.log("Building tailwindcss")
await $`bun x tailwindcss -o ${src_dir}/lib/tailwind.css --minify`
await $`bun x tailwindcss -o ${root_dir}/lib/tailwind.css --minify`
console.log("Fetching htmx from node_modules")
const htmx = Bun.file(`${src_dir}/node_modules/htmx.org/dist/htmx.min.js`)
await Bun.write(`${src_dir}/lib/htmx.js`, htmx)
const htmx = Bun.file(`${root_dir}/node_modules/htmx.org/dist/htmx.min.js`)
await Bun.write(`${root_dir}/lib/htmx.js`, htmx)
if (sys.args.includes("--install")) {
console.log("Installing systemd service")
await $`cp --target-directory=/etc/systemd/system/ ${src_dir}/config/www.service`
await $`cp --target-directory=/etc/systemd/system/ ${root_dir}/config/www.service`
await $`systemctl daemon-reload`
await $`systemctl enable www.service`
console.log("Setting group to www-data")
await $`chown -R :www-data ${src_dir}`
await $`chown -R :www-data ${root_dir}`
}
console.log("Setup finished!")