Skip to content

Commit

Permalink
Update check-deps.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
kw1knode authored Nov 5, 2024
1 parent 552bdf9 commit 2ddfe6f
Showing 1 changed file with 52 additions and 20 deletions.
72 changes: 52 additions & 20 deletions scripts/check-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,56 @@ error() {
check_command() {
local cmd=$1
if ! command -v "$cmd" &> /dev/null; then
if [ "$cmd" = "talosctl" ]; then
echo ""
log "talosctl not found. Installation instructions:"
echo ""
echo "Please visit: https://www.talos.dev/v1.8/talos-guides/install/talosctl/"
echo ""
echo "Quick installation methods:"
echo ""
echo "1. Using curl (Linux/macOS):"
echo " curl -Lo /usr/local/bin/talosctl https://github.com/siderolabs/talos/releases/latest/download/talosctl-\$(uname -s | tr \"[:upper:]\" \"[:lower:]\")-amd64"
echo " chmod +x /usr/local/bin/talosctl"
echo ""
echo "2. Using Homebrew (macOS):"
echo " brew install siderlabs/talos/talosctl"
echo ""
error "$cmd is not installed and is required"
else
error "$cmd is not installed and is required"
fi
case "$cmd" in
"talosctl")
echo ""
log "talosctl not found. Installation instructions:"
echo ""
echo "Please visit: https://www.talos.dev/v1.8/talos-guides/install/talosctl/"
echo ""
echo "Quick installation methods:"
echo ""
echo "1. Using curl (Linux/macOS):"
echo " curl -Lo /usr/local/bin/talosctl https://github.com/siderolabs/talos/releases/latest/download/talosctl-\$(uname -s | tr \"[:upper:]\" \"[:lower:]\")-amd64"
echo " chmod +x /usr/local/bin/talosctl"
echo ""
echo "2. Using Homebrew (macOS):"
echo " brew install siderlabs/talos/talosctl"
;;
"kubectl")
echo ""
log "kubectl not found. Installation instructions:"
echo ""
echo "Please visit: https://kubernetes.io/docs/tasks/tools/"
echo ""
echo "Quick installation methods:"
echo ""
echo "1. Using curl (Linux):"
echo " curl -LO \"https://dl.k8s.io/release/\$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl\""
echo " chmod +x kubectl"
echo " sudo mv kubectl /usr/local/bin/"
echo ""
echo "2. Using Homebrew (macOS):"
echo " brew install kubectl"
echo ""
echo "3. Using package manager (Ubuntu/Debian):"
echo " sudo apt-get update && sudo apt-get install -y kubectl"
;;
"yq")
echo ""
log "yq not found. Installation instructions:"
echo ""
echo "Quick installation methods:"
echo ""
echo "1. Using wget (Linux):"
echo " wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/local/bin/yq"
echo " chmod +x /usr/local/bin/yq"
echo ""
echo "2. Using Homebrew (macOS):"
echo " brew install yq"
;;
esac
error "$cmd is not installed and is required"
else
log "$cmd is installed ($(command -v "$cmd"))"
fi
Expand All @@ -55,8 +86,9 @@ main() {
check_command git
check_command yq
check_command talosctl
check_command kubectl

log "All dependencies are satisfied"
}

main "$@"
main "$@"

0 comments on commit 2ddfe6f

Please sign in to comment.