@@ -7,10 +7,9 @@ import fs from 'node:fs';
7
7
// biome-ignore lint/nursery/noRestrictedImports: ignore
8
8
import path from 'node:path' ;
9
9
import { timerify } from './Performance.js' ;
10
- import parsedArgValues from './cli-arguments.js' ;
11
10
import { debugLog } from './debug.js' ;
12
11
import { isDirectory , isFile } from './fs.js' ;
13
- import { dirname , isAbsolute , resolve } from './path.js' ;
12
+ import { cwd , dirname , isAbsolute , resolve } from './path.js' ;
14
13
import { deserialize , serialize } from './serialize.js' ;
15
14
16
15
type MetaData < T > = { size : number ; mtime : number ; data ?: T } ;
@@ -23,8 +22,6 @@ export type FileDescriptor<T> = {
23
22
meta ?: MetaData < T > ;
24
23
} ;
25
24
26
- const cwd = process . cwd ( ) ;
27
-
28
25
const createCache = ( filePath : string ) => {
29
26
try {
30
27
return deserialize ( fs . readFileSync ( filePath ) ) ;
@@ -41,10 +38,7 @@ export class FileEntryCache<T> {
41
38
normalizedEntries = new Map < string , FileDescriptor < T > > ( ) ;
42
39
43
40
constructor ( cacheId : string , _path : string ) {
44
- const { 'cache-location' : cacheLocation } = parsedArgValues ;
45
- const currentPath = cacheLocation ? path . resolve ( cacheLocation ) : path . resolve ( cwd ) ;
46
- this . filePath = isAbsolute ( currentPath ) ? path . join ( currentPath , cacheId ) : path . join ( currentPath , _path , cacheId ) ;
47
-
41
+ this . filePath = isAbsolute ( _path ) ? path . resolve ( _path , cacheId ) : path . resolve ( cwd , _path , cacheId ) ;
48
42
if ( isFile ( this . filePath ) ) this . cache = create ( this . filePath ) ;
49
43
this . removeNotFoundFiles ( ) ;
50
44
}
0 commit comments