Skip to content

Commit

Permalink
fix: add human-readable error when nc is not installed on the host
Browse files Browse the repository at this point in the history
Signed-off-by: Kanishk Pachauri <[email protected]>
  • Loading branch information
Mr-Sunglasses committed Oct 22, 2024
1 parent 14447a8 commit bea4868
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions hack/test-port-forwarding.pl
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,17 @@
exit;
}

# Check if netcat is available before running tests
my $nc_path = `command -v nc 2>/dev/null`;
chomp $nc_path;
unless ($nc_path) {
die "Error: 'nc' (netcat) is not installed on the host system.\n" .
"Please install netcat to run this test script:\n" .
" - On macOS: brew install netcat\n" .
" - On Ubuntu/Debian: sudo apt-get install netcat\n" .
" - On RHEL/CentOS: sudo yum install nmap-ncat\n";
}

# Otherwise $instance must be the name of an already running instance that has been
# configured with our portForwards settings.

Expand Down

0 comments on commit bea4868

Please sign in to comment.