Skip to content

Commit 94221fa

Browse files
fix: add human-readable error when nc is not installed on the host
1 parent 14447a8 commit 94221fa

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Diff for: hack/test-port-forwarding.pl

+11
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,17 @@
5454
exit;
5555
}
5656

57+
# Check if netcat is available before running tests
58+
my $nc_path = `command -v nc 2>/dev/null`;
59+
chomp $nc_path;
60+
unless ($nc_path) {
61+
die "Error: 'nc' (netcat) is not installed on the host system.\n" .
62+
"Please install netcat to run this test script:\n" .
63+
" - On macOS: brew install netcat\n" .
64+
" - On Ubuntu/Debian: sudo apt-get install netcat\n" .
65+
" - On RHEL/CentOS: sudo yum install nmap-ncat\n";
66+
}
67+
5768
# Otherwise $instance must be the name of an already running instance that has been
5869
# configured with our portForwards settings.
5970

0 commit comments

Comments
 (0)