Skip to content

Commit bae7e7f

Browse files
committed
refactor(hacktools): add dependency preflight
1 parent 886b4e1 commit bae7e7f

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

setup/install_hacktools.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@ printf "${bblue} Sourcing environment variables ${reset}\n"
3232
printf "${yellow} TOOLS_PATH is set to: %s ${reset}\n" "$TOOLS_PATH"
3333
printf "${yellow} LISTS_PATH is set to: %s ${reset}\n\n" "$LISTS_PATH"
3434

35+
require_cmd() {
36+
local cmd="$1"
37+
if ! command -v "$cmd" >/dev/null 2>&1; then
38+
printf "${red}[!] Required command not found: %s${reset}\n" "$cmd"
39+
exit 1
40+
fi
41+
}
42+
43+
require_cmd git
44+
require_cmd wget
45+
require_cmd python3
46+
3547
printf "${bblue} Running: Installing Golang tools ${reset}\n\n"
3648

3749
# Detect Go installation

0 commit comments

Comments
 (0)