File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -6,18 +6,20 @@ const delay = (ms) => new Promise((result) => setTimeout(result, ms));
66async function getDefaultInterface ( ) {
77 const command =
88 "sudo ip route | awk '/default/ {print $5; exit}' | tr -d '\n'" ;
9- const result = await shell ( command , { shell : true } ) ;
9+ const result = await shell ( command ) ;
1010
1111 if ( result . stdout . length === 0 && result . stderr . length > 0 ) {
1212 throw new Error (
1313 'There was an error getting the default interface:\n\n' + result . stderr
1414 ) ;
1515 } else if ( result . stdout . length === 0 ) {
1616 // lets do one retry
17+ // The GitHub Actions sometimes cannot find the interface
1718 await delay ( 1000 ) ;
18- const result = await shell ( command , { shell : true } ) ;
19+ const result = await shell ( command ) ;
1920 if ( result . stdout . length === 0 ) {
20- throw new Error ( 'There was an error getting the default interface' ) ;
21+ const result = await shell ( 'sudo ip route show' ) ;
22+ throw new Error ( 'There was an error getting the default interface %s' , result . stdout ) ;
2123 }
2224 return result . stdout ;
2325 }
You can’t perform that action at this time.
0 commit comments