Open-source AI penetration testing tool to find and fix your app’s vulnerabilities.
Python agentsai-hackingai-penetration-testingai-pentestingai-securityartificial-intelligencebug-bountycode-qualityctf-toolscybersecuritycybersecurity-toolsethical-hackinghackingllm-securityoffensive-securitypenetration-testingpentesting-toolsred-teamingsecuritysecurity-automation
fix: improve install script PATH handling for more shells
0xallam7417e6f8d0be
diff --git a/scripts/install.sh b/scripts/install.shindex 55ab10ff..07ec154a 100755--- a/scripts/install.sh+++ b/scripts/install.sh@@ -209,11 +209,16 @@ check_docker() {add_to_path() {local config_file=$1local command=$2+if grep -Fxq "$command" "$config_file" 2>/dev/null; then- return 0+ print_message info "${MUTED}PATH already configured in ${NC}$config_file"elif [[ -w $config_file ]]; thenecho -e "\n# strix" >> "$config_file"echo "$command" >> "$config_file"+ print_message info "${MUTED}Successfully added ${NC}strix ${MUTED}to \$PATH in ${NC}$config_file"+ else+ print_message warning "Manually add the directory to $config_file (or similar):"+ print_message info " $command"fi}@@ -226,13 +231,19 @@ setup_path() {config_files="$HOME/.config/fish/config.fish";;zsh)- config_files="$HOME/.zshrc $HOME/.zshenv"+ config_files="${ZDOTDIR:-$HOME}/.zshrc ${ZDOTDIR:-$HOME}/.zshenv $XDG_CONFIG_HOME/zsh/.zshrc $XDG_CONFIG_HOME/zsh/.zshenv";;bash)- config_files="$HOME/.bashrc $HOME/.bash_profile $HOME/.profile"+ config_files="$HOME/.bashrc $HOME/.bash_profile $HOME/.profile $XDG_CONFIG_HOME/bash/.bashrc $XDG_CONFIG_HOME/bash/.bash_profile"+ ;;+ ash)+ config_files="$HOME/.ashrc $HOME/.profile /etc/profile"+ ;;+ sh)+ config_files="$HOME/.ashrc $HOME/.profile /etc/profile";;*)- config_files="$HOME/.bashrc $HOME/.profile"+ config_files="$HOME/.bashrc $HOME/.bash_profile $XDG_CONFIG_HOME/bash/.bashrc $XDG_CONFIG_HOME/bash/.bash_profile";;esac@@ -245,23 +256,36 @@ setup_path() {doneif [[ -z $config_file ]]; then- config_file="$HOME/.bashrc"- touch "$config_file"- fi-- if [[ ":$PATH:" != *":$INSTALL_DIR:"* ]]; then+ print_message warning "No config file found for $current_shell. You may need to manually add to PATH:"+ print_message info " export PATH=$INSTALL_DIR:\$PATH"+ elif [[ ":$PATH:" != *":$INSTALL_DIR:"* ]]; thencase $current_shell infish)add_to_path "$config_file" "fish_add_path $INSTALL_DIR";;+ zsh)+ add_to_path "$config_file" "export PATH=$INSTALL_DIR:\$PATH"+ ;;+ bash)+ add_to_path "$config_file" "export PATH=$INSTALL_DIR:\$PATH"+ ;;+ ash)+ add_to_path "$config_file" "export PATH=$INSTALL_DIR:\$PATH"+ ;;+ sh)+ add_to_path "$config_file" "export PATH=$INSTALL_DIR:\$PATH"+ ;;*)- add_to_path "$config_file" "export PATH=\"$INSTALL_DIR:\$PATH\""+ export PATH=$INSTALL_DIR:$PATH+ print_message warning "Manually add the directory to $config_file (or similar):"+ print_message info " export PATH=$INSTALL_DIR:\$PATH";;esacfiif [ -n "${GITHUB_ACTIONS-}" ] && [ "${GITHUB_ACTIONS}" == "true" ]; thenecho "$INSTALL_DIR" >> "$GITHUB_PATH"+ print_message info "Added $INSTALL_DIR to \$GITHUB_PATH"fi}