File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -88,8 +88,6 @@ async function startProcess(opts) {
8888 activeProcess = null ;
8989 } ) ;
9090
91- process . on ( "exit" , async ( ) => await killProcess ( ) ) ;
92-
9391 try {
9492 const url = await apiUrl ;
9593 activeProcess = ngrok ;
@@ -107,13 +105,21 @@ async function startProcess(opts) {
107105}
108106
109107function killProcess ( ) {
110- if ( ! activeProcess ) return ;
108+ if ( ! activeProcess ) {
109+ return Promise . resolve ( ) ;
110+ }
111111 return new Promise ( ( resolve ) => {
112112 activeProcess . on ( "exit" , ( ) => resolve ( ) ) ;
113113 activeProcess . kill ( ) ;
114114 } ) ;
115115}
116116
117+ process . on ( "exit" , ( ) => {
118+ if ( activeProcess ) {
119+ activeProcess . kill ( ) ;
120+ }
121+ } ) ;
122+
117123/**
118124 * @param {string | Ngrok.Options } optsOrToken
119125 */
You can’t perform that action at this time.
0 commit comments