made it beautiful

This commit is contained in:
pika 2025-06-02 14:29:53 +02:00
parent 2ef5a2ece8
commit d010f1e750

View file

@ -30,7 +30,7 @@ getImports() {
source "$import"
sleep 0.3
rm "$import"
echo_warning "cleaned $import"
pen bold yellow "cleaned $import"
}
generic() {
@ -56,7 +56,7 @@ generic() {
fi
# Fetch latest release from GitHub
echo_info "🔍 Checking latest release of $REPO..."
pen bold blue "🔍 Checking latest release of $REPO..."
latest_release=$(curl -s "https://api.github.com/repos/$REPO/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
latest_version=${latest_release#v} # Remove 'v' prefix (e.g., v0.42.2 → 0.42.2)
@ -70,7 +70,7 @@ generic() {
ARCH="aarch64"
;;
*)
echo_error "❌ Unsupported architecture: $ARCH" >&2
echo-error "❌ Unsupported architecture: $ARCH" >&2
exit 1
;;
esac
@ -79,25 +79,25 @@ generic() {
# Skip if already up-to-date
if [[ "$current_version" == "$latest_version" ]]; then
echo_note "✅ Already on the latest version ($latest_version). No action needed."
pen bold blue "✅ Already on the latest version ($latest_version). No action needed."
exit 0
fi
# Download and install
echo_info "⬇️ Downloading $BINARY_NAME $latest_version for $ARCH..."
pen bold blue "⬇️ Downloading $BINARY_NAME $latest_version for $ARCH..."
curl -sL "$download_url" | tar -xz -C "$TMP_DIR"
echo_info "🛠️ Installing to $INSTALL_DIR..."
pen bold blue "🛠️ Installing to $INSTALL_DIR..."
mv -f "$TMP_DIR/$BINARY_NAME" "$INSTALL_DIR/"
# Verify
if [[ -f "$INSTALL_DIR/$BINARY_NAME" ]]; then
chmod +x "$INSTALL_DIR/$BINARY_NAME"
echo_info "🎉 Successfully installed $BINARY_NAME $latest_version to $INSTALL_DIR/"
echo_warning "💡 Ensure '$INSTALL_DIR' is in your PATH:"
echo_warning " export PATH=\"$INSTALL_DIR:\$PATH\""
pen bold blue "🎉 Successfully installed $BINARY_NAME $latest_version to $INSTALL_DIR/"
pen bold yellow "💡 Ensure '$INSTALL_DIR' is in your PATH:"
pen bold yellow " export PATH=\"$INSTALL_DIR:\$PATH\""
else
echo_error "❌ Installation failed!" >&2
echo-error "❌ Installation failed!" >&2
exit 1
fi
}
@ -106,7 +106,7 @@ setup() {
if getImports; then
case "$@" in
--silent | -s)
echo_warning "Executing script silently.."
pen bold yellow "Executing script silently.."
silent=true
;;
*)