Created
September 14, 2023 15:54
-
-
Save coltenkrauter/636c3c25c8023854afb7451a36acddc7 to your computer and use it in GitHub Desktop.
This zsh script surveys your UNIX system to identify which package managers are installed, swiftly scanning through a predefined list of popular managers and signaling their availability, making the task of installing new software packages a breeze.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
# Define a list of package managers to check | |
package_managers=("apt" "yum" "dnf" "brew" "zypper" "pacman" "emerge" "nix" "snap" "flatpak") | |
echo "Initiating package manager detection..." | |
# Start checking phase | |
echo "\e[32m==> Starting Detection Phase\e[0m" | |
# Loop through the array of package managers and check if they are installed | |
for manager in "${package_managers[@]}"; do | |
if command -v $manager > /dev/null; then | |
echo "\e[35m→ $manager is installed\e[0m" | |
else | |
echo "$manager is not installed" | |
fi | |
done | |
# Ending checking phase | |
echo "\e[32m==> Ending Detection Phase\e[0m" | |
# Conclusion report | |
echo "\e[34m\033[1mConclusion:\033[0m \e[34mAbove listed are the detected package managers on your system.\e[0m" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment