File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change 1+ #!/usr/bin/env node
2+ const { spawn } = require ( "child_process" ) ;
3+ const { normalize } = require ( "path" ) ;
4+
5+ const termiateSignals = [ "close" , "exit" , "" ] ;
6+
7+ function startSubprocess ( ) {
8+ return new Promise ( ( res , rej ) => {
9+ const proc = spawn ( process . argv . slice ( 2 ) . map ( normalize ) . join ( " " ) , {
10+ stdio : [ "pipe" , "pipe" , "pipe" ] ,
11+ shell :
12+ process . platform === "win32" ||
13+ / ^ ( m s y s | c y g w i n ) $ / . test ( process . env . OSTYPE ) ,
14+ } ) ;
15+ proc . stdout . pipe ( process . stdout ) ;
16+ proc . stderr . pipe ( process . stderr ) ;
17+ process . stdin . pipe ( proc . stdin ) ;
18+ termiateSignals . forEach ( ( e ) => proc . on ( e , res ) ) ;
19+ proc . on ( "error" , rej ) ;
20+ } ) ;
21+ }
22+
23+ async function loop ( ) {
24+ let code = 64 ;
25+ while ( code === 64 ) code = await startSubprocess ( ) ;
26+ }
27+
28+ loop ( ) ;
Original file line number Diff line number Diff line change 88 "scripts" : {
99 "build" : " webpack --mode production" ,
1010 "dev" : " webpack --mode=development" ,
11- "start" : " ./ livereload.sh node_modules/.bin/qode ./dist/index.js" ,
11+ "start" : " node livereload.js node_modules/.bin/qode ./dist/index.js" ,
1212 "debug" : " qode --inspect ./dist/index.js"
1313 },
1414 "dependencies" : {
You can’t perform that action at this time.
0 commit comments