File tree 2 files changed +4
-17
lines changed 2 files changed +4
-17
lines changed Original file line number Diff line number Diff line change @@ -25,20 +25,6 @@ const getText = async url => {
25
25
return text ;
26
26
} ;
27
27
28
- const any = async asyncFunctions => {
29
- const errors = [ ] ;
30
- for ( const function_ of asyncFunctions ) {
31
- try {
32
- // eslint-disable-next-line no-await-in-loop
33
- return await function_ ( ) ;
34
- } catch ( error ) {
35
- errors . push ( error ) ;
36
- }
37
- }
38
-
39
- throw new AggregateError ( errors , 'All failed.' ) ;
40
- } ;
41
-
42
28
const getSpecification = async ( ) => {
43
29
let stat ;
44
30
@@ -54,7 +40,7 @@ const getSpecification = async () => {
54
40
await fs . rm ( CACHE_FILE ) ;
55
41
}
56
42
57
- const text = await any ( SPECIFICATION_URLS . map ( url => ( ) => getText ( url ) ) ) ;
43
+ const text = await Promise . any ( SPECIFICATION_URLS . map ( url => getText ( url ) ) ) ;
58
44
59
45
await fs . mkdir ( new URL ( './' , CACHE_FILE ) , { recursive : true } ) ;
60
46
await fs . writeFile ( CACHE_FILE , text ) ;
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ const ALL_JOBS = [
12
12
{
13
13
environment : 'builtin' ,
14
14
getGlobals : getBuiltinGlobals ,
15
+ incremental : false ,
15
16
} ,
16
17
{
17
18
environment : 'nodeBuiltin' ,
@@ -42,7 +43,7 @@ async function run(options) {
42
43
? ALL_JOBS . filter ( job => job . environment === options . environment )
43
44
: ALL_JOBS ;
44
45
45
- for ( const { environment, getGlobals, incremental = false } of jobs ) {
46
+ for ( const { environment, getGlobals, incremental = true } of jobs ) {
46
47
const {
47
48
added,
48
49
removed,
@@ -52,7 +53,7 @@ async function run(options) {
52
53
environment,
53
54
getGlobals,
54
55
dryRun : options . dry ,
55
- incremental : incremental ?? ! options . clean ,
56
+ incremental : options . clean ? false : incremental ,
56
57
} ) ;
57
58
58
59
console . log ( `✅ ${ environment } globals updated.` ) ;
You can’t perform that action at this time.
0 commit comments