Skip to content

Commit f599e07

Browse files
committed
More info
1 parent 3f2dc1a commit f599e07

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/tc.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,20 @@ const delay = (ms) => new Promise((result) => setTimeout(result, ms));
66
async 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
}

0 commit comments

Comments
 (0)