Skip to content

Commit b5879ef

Browse files
Trottruyadorno
authored andcommitted
tools: improve macos-firewall.sh output
The output of tools/macos-firewall.sh can cause people to think it didn't work. Update things slightly to make the output mildly more informative. Refs: #37233 (comment) PR-URL: #37846 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent dbc4804 commit b5879ef

File tree

1 file changed

+17
-28
lines changed

1 file changed

+17
-28
lines changed

tools/macos-firewall.sh

+17-28
Original file line numberDiff line numberDiff line change
@@ -21,36 +21,25 @@ CCTEST_DEBUG="$OUTDIR/Debug/cctest"
2121
OPENSSL_CLI_RELEASE="$OUTDIR/Release/openssl-cli"
2222
OPENSSL_CLI_DEBUG="$OUTDIR/Debug/openssl-cli"
2323

24+
add_and_unblock () {
25+
if [ -e "$1" ]
26+
then
27+
echo Processing "$1"
28+
$SFW --remove "$1" >/dev/null
29+
$SFW --add "$1"
30+
$SFW --unblock "$1"
31+
fi
32+
}
33+
2434
if [ -f $SFW ];
2535
then
26-
# Duplicating these commands on purpose as the symbolic link node might be
27-
# linked to either out/Debug/node or out/Release/node depending on the
28-
# BUILDTYPE.
29-
$SFW --remove "$NODE_DEBUG"
30-
$SFW --remove "$NODE_DEBUG"
31-
$SFW --remove "$NODE_RELEASE"
32-
$SFW --remove "$NODE_RELEASE"
33-
$SFW --remove "$NODE_LINK"
34-
$SFW --remove "$CCTEST_DEBUG"
35-
$SFW --remove "$CCTEST_RELEASE"
36-
$SFW --remove "$OPENSSL_CLI_DEBUG"
37-
$SFW --remove "$OPENSSL_CLI_RELEASE"
38-
39-
$SFW --add "$NODE_DEBUG"
40-
$SFW --add "$NODE_RELEASE"
41-
$SFW --add "$NODE_LINK"
42-
$SFW --add "$CCTEST_DEBUG"
43-
$SFW --add "$CCTEST_RELEASE"
44-
$SFW --add "$OPENSSL_CLI_DEBUG"
45-
$SFW --add "$OPENSSL_CLI_RELEASE"
46-
47-
$SFW --unblock "$NODE_DEBUG"
48-
$SFW --unblock "$NODE_RELEASE"
49-
$SFW --unblock "$NODE_LINK"
50-
$SFW --unblock "$CCTEST_DEBUG"
51-
$SFW --unblock "$CCTEST_RELEASE"
52-
$SFW --unblock "$OPENSSL_CLI_DEBUG"
53-
$SFW --unblock "$OPENSSL_CLI_RELEASE"
36+
add_and_unblock "$NODE_DEBUG"
37+
add_and_unblock "$NODE_RELEASE"
38+
add_and_unblock "$NODE_LINK"
39+
add_and_unblock "$CCTEST_DEBUG"
40+
add_and_unblock "$CCTEST_RELEASE"
41+
add_and_unblock "$OPENSSL_CLI_DEBUG"
42+
add_and_unblock "$OPENSSL_CLI_RELEASE"
5443
else
5544
echo "SocketFirewall not found in location: $SFW"
5645
fi

0 commit comments

Comments
 (0)