We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a25e92c commit ae2b306Copy full SHA for ae2b306
1 file changed
builder/source/cache.ts
@@ -1,10 +1,14 @@
1
import * as Zod from 'zod'
2
import * as Fs from 'node:fs'
3
import * as Process from 'node:process'
4
+import * as Path from 'node:path'
5
import { FetchAdShieldDomains } from './references/index.js'
6
-const CachePath = (Process.env.INIT_CWD ? Process.env.INIT_CWD : Process.cwd()) + '/.buildcache'
7
-const CacheDomainsPath = CachePath + '/domains.json'
+const BaseCacheDir = (Process.env.INIT_CWD && Path.isAbsolute(Process.env.INIT_CWD))
8
+ ? Process.env.INIT_CWD
9
+ : Process.cwd()
10
+const CachePath = Path.join(Path.resolve(BaseCacheDir), '.buildcache')
11
+const CacheDomainsPath = Path.join(CachePath, 'domains.json')
12
13
export function CreateCache(Domains: Set<string>) {
14
if (!Fs.existsSync(CachePath)) {
0 commit comments