refactor: Remove wget fallbacks

This commit is contained in:
2026-06-21 12:54:45 +05:30
parent 3df936d501
commit b8862b925e
17 changed files with 71 additions and 244 deletions

View File

@@ -14,12 +14,10 @@ METASCRIPT_URL="https://git.adityagupta.dev/sortedcord/bootstrap/raw/branch/mast
if [ -f "$METASCRIPT_LOCAL" ]; then
. "$METASCRIPT_LOCAL"
else
if command -v wget >/dev/null 2>&1; then
eval "$(wget -qO- "$METASCRIPT_URL")"
elif command -v curl >/dev/null 2>&1; then
if command -v curl >/dev/null 2>&1; then
eval "$(curl -fsSL "$METASCRIPT_URL")"
else
echo "Error: Neither wget nor curl is installed to fetch bootstrap.sh." >&2
echo "Error: curl is not installed to fetch bootstrap.sh." >&2
exit 1
fi
fi
@@ -49,15 +47,11 @@ install_bat() {
elif [ "$distro" = "debian" ]; then
log_info "Debian/Ubuntu detected"
pkg_install curl wget
pkg_install curl
log_info "Fetching latest Bat version from GitHub..."
local latest_tag=""
if has_command curl; then
latest_tag=$(curl -sL https://api.github.com/repos/sharkdp/bat/releases/latest | grep '"tag_name":' | head -n1 | sed -E 's/.*"tag_name": "([^"]+)".*/\1/' || true)
elif has_command wget; then
latest_tag=$(wget -qO- https://api.github.com/repos/sharkdp/bat/releases/latest | grep '"tag_name":' | head -n1 | sed -E 's/.*"tag_name": "([^"]+)".*/\1/' || true)
fi
if [ -z "$latest_tag" ]; then
latest_tag="v0.26.1"
@@ -79,11 +73,7 @@ install_bat() {
local deb_url="https://github.com/sharkdp/bat/releases/download/${latest_tag}/bat_${version}_${deb_arch}.deb"
log_info "Downloading Bat from ${deb_url}..."
if has_command curl; then
curl -fsSL "$deb_url" -o "$TMP_DIR/bat.deb"
else
wget -qO "$TMP_DIR/bat.deb" "$deb_url"
fi
log_info "Installing Bat package..."
sudo apt install -y "$TMP_DIR/bat.deb"