Something went wrong. Try again.
Mirroring: https://github.com/MunifTanjim/scripts.sh
Something went wrong. Try again.
scripts.sh setup-fd
731 B · 47 lines
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748#!/usr/bin/env bash
set -euo pipefail
command_exists() { type "${1}" >/dev/null 2>&1}
ensure_tool() { local -r tool="${1}" if ! type "${tool}" >/dev/null 2>&1; then echo "missing required tool: ${tool}" exit 1 fi}
setup_for_darwin() { ensure_tool brew
echo 'brew "fd"' | brew bundle --file=-}
setup_for_debian() { local pattern="musl.+amd64.deb" if test "$(uname -m)" = "aarch64"; then pattern="arm64.deb" fi
setup-from-github-release "sharkdp/fd" "${pattern}"}
setup_fd() { case $OSTYPE in darwin*) setup_for_darwin;; linux*) if command_exists dpkg; then setup_for_debian fi ;; *) echo "Unknown OS!" exit 1;; esac}
setup_fd