File tree 1 file changed +3
-16
lines changed 1 file changed +3
-16
lines changed Original file line number Diff line number Diff line change 1
1
const fs = require ( 'fs' ) . promises ;
2
2
const { exec } = require ( 'child_process' ) ;
3
3
const core = require ( '@actions/core' ) ;
4
- const { nextTick } = require ( 'process' ) ;
5
- const { AbortController } = require ( "node-abort-controller" ) ;
4
+ const util = require ( 'util' ) ;
6
5
( async ( ) => {
7
6
const [ currentDefinitions , currentDocs ] = await Promise . all ( [
8
7
fs . readFile ( './src/Options/Definitions.js' , 'utf8' ) ,
9
8
fs . readFile ( './src/Options/docs.js' , 'utf8' ) ,
10
9
] ) ;
11
- exec ( 'npm run definitions' ) ;
12
- const ac = new AbortController ( ) ;
13
- const { signal } = ac ;
14
- const watcher = fs . watch ( './src/Options/docs.js' , { signal} ) ;
15
- let i = 0 ;
16
- // eslint-disable-next-line
17
- for await ( const _ of watcher ) {
18
- i ++ ;
19
- if ( i === 3 ) {
20
- ac . abort ( ) ;
21
- break ;
22
- }
23
- }
24
- await new Promise ( resolve => nextTick ( resolve ) ) ;
10
+ const execute = util . promisify ( exec ) ;
11
+ await execute ( 'npm run definitions' ) ;
25
12
const [ newDefinitions , newDocs ] = await Promise . all ( [
26
13
fs . readFile ( './src/Options/Definitions.js' , 'utf8' ) ,
27
14
fs . readFile ( './src/Options/docs.js' , 'utf8' ) ,
You can’t perform that action at this time.
0 commit comments