File tree 3 files changed +10
-10
lines changed
3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -77,12 +77,13 @@ const args = yargs(hideBin(process.argv))
77
77
} )
78
78
. option ( 'stats' , {
79
79
default : false ,
80
+ type : 'boolean' ,
80
81
describe : 'Aggregate the results'
81
82
} )
82
83
. option ( 'cache' , {
83
84
default : false ,
84
- describe : 'Cache the responses from Jenkins in .ncu/cache/ under' +
85
- ' the node-core-utils installation directory '
85
+ type : 'boolean' ,
86
+ describe : 'Cache the responses from Jenkins in $tmpdir/ncu/cache for testing '
86
87
} )
87
88
. option ( 'limit' , {
88
89
default : 99 ,
@@ -199,13 +200,14 @@ const args = yargs(hideBin(process.argv))
199
200
builder : ( yargs ) => {
200
201
yargs
201
202
. option ( 'stats' , {
203
+ type : 'boolean' ,
202
204
default : false ,
203
205
describe : 'Aggregate the results'
204
206
} )
205
207
. option ( 'cache' , {
208
+ type : 'boolean' ,
206
209
default : false ,
207
- describe : 'Cache the responses from Jenkins in .ncu/cache/ under' +
208
- ' the node-core-utils installation directory'
210
+ describe : 'Cache the responses from Jenkins in $tmpdir/ncu/cache for testing'
209
211
} )
210
212
. option ( 'limit' , {
211
213
default : 15 ,
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ Possible use cases:
111
111
is run, it picks up cached data written on disk for jobs whose results
112
112
are known.
113
113
114
- Note: results are cached in ` ${ncu_installation_path}/. ncu/cache ` , so you
114
+ Note: results are cached in ` $tmpdir/ ncu/cache ` , so you
115
115
may want to clean it up from time to time.
116
116
117
117
```
Original file line number Diff line number Diff line change 1
1
import path from 'node:path' ;
2
2
import fs from 'node:fs' ;
3
- import { fileURLToPath } from 'node:url ' ;
3
+ import os from 'node:os ' ;
4
4
5
5
import { writeJson , readJson , writeFile , readFile } from './file.js' ;
6
6
7
7
function isAsync ( fn ) {
8
8
return fn [ Symbol . toStringTag ] === 'AsyncFunction' ;
9
9
}
10
10
11
- const parentDir = fileURLToPath ( new URL ( '..' , import . meta. url ) ) ;
12
-
13
11
export default class Cache {
14
12
constructor ( dir ) {
15
- this . dir = dir || this . computeCacheDir ( parentDir ) ;
13
+ this . dir = dir || this . computeCacheDir ( os . tmpdir ( ) ) ;
16
14
this . originals = { } ;
17
15
this . disabled = true ;
18
16
}
19
17
20
18
computeCacheDir ( base ) {
21
- return path . join ( base , '. ncu' , 'cache' ) ;
19
+ return path . join ( base , 'ncu' , 'cache' ) ;
22
20
}
23
21
24
22
disable ( ) {
You can’t perform that action at this time.
0 commit comments