feat: use correct path for visitcount file
All checks were successful
create archive with lfs / tag (push) Successful in 7s

This commit is contained in:
dusk 2024-10-01 04:41:32 +03:00
parent d62b71db61
commit dd18844dc4
Signed by: dusk
SSH Key Fingerprint: SHA256:Abmvag+juovVufZTxyWY8KcVgrznxvBjQpJesv071Aw

View File

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