feat: use correct path for visitcount file
All checks were successful
create archive with lfs / tag (push) Successful in 7s
All checks were successful
create archive with lfs / tag (push) Successful in 7s
This commit is contained in:
parent
d62b71db61
commit
dd18844dc4
@ -1,5 +1,6 @@
|
|||||||
import type { Cookies } from '@sveltejs/kit'
|
import type { Cookies } from '@sveltejs/kit'
|
||||||
import { existsSync, readFileSync } from 'fs'
|
import { existsSync, readFileSync } from 'fs'
|
||||||
|
import { cwd } from 'process'
|
||||||
import { writable } from 'svelte/store'
|
import { writable } from 'svelte/store'
|
||||||
|
|
||||||
export const scopeCookies = (cookies: Cookies, path: string) => {
|
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'));
|
export const visitCount = writable(parseInt(existsSync(visitCountFile) ? readFileSync(visitCountFile).toString() : '0'));
|
Loading…
Reference in New Issue
Block a user