Skip to content

Commit 88f514c

Browse files
committed
Fix macOS path initialization
1 parent d270043 commit 88f514c

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

reconftw.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6037,8 +6037,21 @@ function help() {
60376037

60386038
# macOS PATH initialization, thanks @0xtavian <3
60396039
if [[ $OSTYPE == "darwin"* ]]; then
6040-
PATH="/usr/local/opt/gnu-getopt/bin:$PATH"
6041-
PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
6040+
if ! command -v brew &> /dev/null; then
6041+
printf "\n%bBrew is not installed or not in the PATH.%b\n\n" "$bred" "$reset"
6042+
exit 1
6043+
fi
6044+
if [[ ! -x "$(brew --prefix gnu-getopt)/bin/getopt" ]]; then
6045+
printf "\n%bBrew formula gnu-getopt is not installed.%b\n\n" "$bred" "$reset"
6046+
exit 1
6047+
fi
6048+
if [[ ! -d "$(brew --prefix coreutils)/libexec/gnubin" ]]; then
6049+
printf "\n%bBrew formula coreutils is not installed.%b\n\n" "$bred" "$reset"
6050+
exit 1
6051+
fi
6052+
# Prefix is different depending on Intel vs Apple Silicon
6053+
PATH="$(brew --prefix gnu-getopt)/bin:$PATH"
6054+
PATH="$(brew --prefix coreutils)/libexec/gnubin:$PATH"
60426055
fi
60436056

60446057
PROGARGS=$(getopt -o 'd:m:l:x:i:o:f:q:c:z:rspanwvh::' --long 'domain:,list:,recon,subdomains,passive,all,web,osint,zen,deep,help,vps' -n 'reconFTW' -- "$@")

0 commit comments

Comments
 (0)