made it beautiful
This commit is contained in:
parent
2ef5a2ece8
commit
d010f1e750
1 changed files with 11 additions and 11 deletions
22
zellij.sh
22
zellij.sh
|
@ -30,7 +30,7 @@ getImports() {
|
||||||
source "$import"
|
source "$import"
|
||||||
sleep 0.3
|
sleep 0.3
|
||||||
rm "$import"
|
rm "$import"
|
||||||
echo_warning "cleaned $import"
|
pen bold yellow "cleaned $import"
|
||||||
}
|
}
|
||||||
|
|
||||||
generic() {
|
generic() {
|
||||||
|
@ -56,7 +56,7 @@ generic() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Fetch latest release from GitHub
|
# 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_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)
|
latest_version=${latest_release#v} # Remove 'v' prefix (e.g., v0.42.2 → 0.42.2)
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ generic() {
|
||||||
ARCH="aarch64"
|
ARCH="aarch64"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo_error "❌ Unsupported architecture: $ARCH" >&2
|
echo-error "❌ Unsupported architecture: $ARCH" >&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
@ -79,25 +79,25 @@ generic() {
|
||||||
|
|
||||||
# Skip if already up-to-date
|
# Skip if already up-to-date
|
||||||
if [[ "$current_version" == "$latest_version" ]]; then
|
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
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Download and install
|
# 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"
|
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/"
|
mv -f "$TMP_DIR/$BINARY_NAME" "$INSTALL_DIR/"
|
||||||
|
|
||||||
# Verify
|
# Verify
|
||||||
if [[ -f "$INSTALL_DIR/$BINARY_NAME" ]]; then
|
if [[ -f "$INSTALL_DIR/$BINARY_NAME" ]]; then
|
||||||
chmod +x "$INSTALL_DIR/$BINARY_NAME"
|
chmod +x "$INSTALL_DIR/$BINARY_NAME"
|
||||||
echo_info "🎉 Successfully installed $BINARY_NAME $latest_version to $INSTALL_DIR/"
|
pen bold blue "🎉 Successfully installed $BINARY_NAME $latest_version to $INSTALL_DIR/"
|
||||||
echo_warning "💡 Ensure '$INSTALL_DIR' is in your PATH:"
|
pen bold yellow "💡 Ensure '$INSTALL_DIR' is in your PATH:"
|
||||||
echo_warning " export PATH=\"$INSTALL_DIR:\$PATH\""
|
pen bold yellow " export PATH=\"$INSTALL_DIR:\$PATH\""
|
||||||
else
|
else
|
||||||
echo_error "❌ Installation failed!" >&2
|
echo-error "❌ Installation failed!" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,7 @@ setup() {
|
||||||
if getImports; then
|
if getImports; then
|
||||||
case "$@" in
|
case "$@" in
|
||||||
--silent | -s)
|
--silent | -s)
|
||||||
echo_warning "Executing script silently.."
|
pen bold yellow "Executing script silently.."
|
||||||
silent=true
|
silent=true
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue