fix: pull data dir from env var
All checks were successful
create archive with lfs / tag (push) Successful in 8s

This commit is contained in:
dusk 2024-10-01 04:53:50 +03:00
parent dd18844dc4
commit 75dc37835c
Signed by: dusk
SSH Key Fingerprint: SHA256:Abmvag+juovVufZTxyWY8KcVgrznxvBjQpJesv071Aw

View File

@ -1,6 +1,6 @@
import type { Cookies } from '@sveltejs/kit'
import { WEBSITE_DATA_DIR } from '$env/static/private'
import { existsSync, readFileSync } from 'fs'
import { cwd } from 'process'
import { writable } from 'svelte/store'
export const scopeCookies = (cookies: Cookies, path: string) => {
@ -17,5 +17,5 @@ export const scopeCookies = (cookies: Cookies, path: string) => {
}
}
export const visitCountFile = `${cwd()}/visitcount`
export const visitCountFile = `${WEBSITE_DATA_DIR}/visitcount`
export const visitCount = writable(parseInt(existsSync(visitCountFile) ? readFileSync(visitCountFile).toString() : '0'));