File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,10 +4,14 @@ import * as Process from 'node:process'
44import * as Path from 'node:path'
55import { FetchAdShieldDomains } from './references/index.js'
66
7- 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' )
7+ const ProjectRoot = Path . resolve ( Process . cwd ( ) )
8+ const EnvInitCwd = Process . env . INIT_CWD && Path . isAbsolute ( Process . env . INIT_CWD )
9+ ? Path . resolve ( Process . env . INIT_CWD )
10+ : null
11+ const BaseCacheDir = ( EnvInitCwd && ( EnvInitCwd === ProjectRoot || EnvInitCwd . startsWith ( ProjectRoot + Path . sep ) ) )
12+ ? EnvInitCwd
13+ : ProjectRoot
14+ const CachePath = Path . join ( BaseCacheDir , '.buildcache' )
1115const CacheDomainsPath = Path . join ( CachePath , 'domains.json' )
1216
1317export function CreateCache ( Domains : Set < string > ) {
You can’t perform that action at this time.
0 commit comments