feat: Added command

This commit is contained in:
2026-06-20 18:40:57 +05:30
parent 0978403fa2
commit bad324a5cd
16 changed files with 182 additions and 218 deletions

View File

@@ -32,15 +32,6 @@ install_agy() {
if [ -f "$BINARY_PATH" ]; then
log_info "Notice: 'agy' is already installed at $BINARY_PATH."
log_info "The Antigravity CLI automatically self-updates in the background during regular runs."
if ! confirm "Do you want to perform a fresh reinstall/upgrade anyway?"; then
log_info "Skipping Antigravity CLI installation."
return 0
fi
else
if ! confirm "Install Antigravity CLI (agy)?"; then
log_info "Skipping Antigravity CLI installation."
return 0
fi
fi
# Detect Architecture (map uname -m to amd64 / arm64)

View File

@@ -35,51 +35,16 @@ install_bat() {
if [ "$distro" = "arch" ]; then
log_info "Arch Linux detected"
if has_command bat; then
if ! confirm "Bat is already installed. Reinstall/Upgrade?"; then
log_info "Skipping Bat installation."
return
fi
else
if ! confirm "Install Bat?"; then
log_info "Skipping Bat installation."
return
fi
fi
log_info "Installing Bat..."
pkg_install bat
elif [ "$distro" = "fedora" ]; then
log_info "Fedora detected"
if has_command bat; then
if ! confirm "Bat is already installed. Reinstall/Upgrade?"; then
log_info "Skipping Bat installation."
return
fi
else
if ! confirm "Install Bat?"; then
log_info "Skipping Bat installation."
return
fi
fi
log_info "Installing Bat..."
pkg_install bat
elif [ "$distro" = "debian" ]; then
log_info "Debian/Ubuntu detected"
if has_command bat; then
if ! confirm "Bat is already installed. Reinstall/Upgrade?"; then
log_info "Skipping Bat installation."
return
fi
else
if ! confirm "Install Bat?"; then
log_info "Skipping Bat installation."
return
fi
fi
pkg_install curl wget

View File

@@ -31,15 +31,7 @@ trap cleanup EXIT
install_nvm() {
if has_command nvm || [ -s "$HOME/.nvm/nvm.sh" ]; then
if ! confirm "NVM is already installed. Reinstall/Upgrade?"; then
log_info "Skipping NVM installation."
return 0
fi
else
if ! confirm "Install NVM (Node Version Manager)?"; then
log_info "Skipping NVM installation."
return 0
fi
log_info "NVM is already installed."
fi
# Ensure required commands are installed
@@ -116,17 +108,6 @@ install_node() {
if has_command node; then
log_info "Currently installed Node.js version: $(node --version)"
if ! confirm "Install/Update to latest Node.js LTS version?"; then
log_info "Skipping Node.js installation."
set -u
return 0
fi
else
if ! confirm "Install Node.js LTS version?"; then
log_info "Skipping Node.js installation."
set -u
return 0
fi
fi
log_info "Installing Node.js LTS version..."

View File

@@ -35,27 +35,8 @@ cleanup() {
trap cleanup EXIT
check_config_dir() {
if [[ -d "$NVIM_CONFIG_DIR" ]]; then
if confirm "$NVIM_CONFIG_DIR already exists. Replace it?"; then
log_info "Existing configuration will be removed during setup."
rm -rf "$NVIM_CONFIG_DIR"
else
while true; do
read -r -p "Enter an alternative directory to clone the configuration into: " alt_dir </dev/tty || true
# Expand tilde (~) to $HOME if the user uses it
alt_dir="${alt_dir/#\~/$HOME}"
if [[ -z "$alt_dir" ]]; then
log_warn "Directory path cannot be empty. Please try again."
continue
fi
NVIM_CONFIG_DIR="$alt_dir"
break
done
fi
fi
# Skip prompt, handled during config clone
return 0
}
install_packages() {
@@ -85,19 +66,9 @@ install_nvim() {
return
fi
log_info "Detected Neovim ${current_version}"
if ! confirm "Upgrade to Neovim v${NVIM_VERSION}?"; then
log_info "Skipping Neovim upgrade."
return
fi
log_info "Detected Neovim ${current_version}. Upgrading to v${NVIM_VERSION}..."
else
log_info "Neovim not installed."
if ! confirm "Install Neovim v${NVIM_VERSION}?"; then
log_info "Skipping Neovim installation."
return
fi
log_info "Installing Neovim v${NVIM_VERSION}..."
fi
# Detect architecture to resolve the release binary name (Fix 4)
@@ -131,14 +102,14 @@ install_nvim() {
}
install_config() {
if [[ -d "$NVIM_CONFIG_DIR" ]]; then
log_info "Neovim configuration directory $NVIM_CONFIG_DIR already exists. Skipping config clone."
return
fi
# Ensure parent directory for the chosen config path exists
mkdir -p "$(dirname "$NVIM_CONFIG_DIR")"
# Quick check if the alternative folder exists and clear it out
if [[ -d "$NVIM_CONFIG_DIR" ]]; then
rm -rf "$NVIM_CONFIG_DIR"
fi
log_info "Cloning configuration to $NVIM_CONFIG_DIR..."
git clone "$NVIM_CONFIG_REPO" "$NVIM_CONFIG_DIR"
log_success "Configuration installed."

View File

@@ -125,15 +125,7 @@ detect_pnpm_arch() {
install_pnpm() {
if has_command pnpm; then
if ! confirm "pnpm is already installed ($(pnpm --version)). Reinstall/Upgrade?"; then
log_info "Skipping pnpm installation."
return
fi
else
if ! confirm "Install pnpm?"; then
log_info "Skipping pnpm installation."
return
fi
log_info "pnpm is already installed ($(pnpm --version))."
fi
local arch libc_suffix version_json version major_version asset_base

View File

@@ -65,15 +65,7 @@ detect_target_triple() {
install_rust() {
if has_command rustup || [ -f "$HOME/.cargo/bin/rustup" ]; then
if ! confirm "Rust (rustup) is already installed. Reinstall/Upgrade?"; then
log_info "Skipping Rust installation."
return
fi
else
if ! confirm "Install Rust (rustup)?"; then
log_info "Skipping Rust installation."
return
fi
log_info "Rust (rustup) is already installed."
fi
install_downloader

View File

@@ -31,15 +31,7 @@ trap cleanup EXIT
install_starship() {
if has_command starship || [ -f "$HOME/.local/bin/starship" ]; then
if ! confirm "Starship is already installed. Reinstall/Upgrade?"; then
log_info "Skipping Starship installation."
return
fi
else
if ! confirm "Install Starship?"; then
log_info "Skipping Starship installation."
return
fi
log_info "Starship is already installed."
fi
# Ensure curl or wget is installed

View File

@@ -35,15 +35,7 @@ install_yay() {
fi
if has_command yay; then
if ! confirm "Yay is already installed. Reinstall/Upgrade?"; then
log_info "Skipping Yay installation."
return
fi
else
if ! confirm "Install Yay?"; then
log_info "Skipping Yay installation."
return
fi
log_info "Yay is already installed."
fi
local needs_install=false

View File

@@ -65,15 +65,7 @@ install_yazi() {
if [ "$distro" = "arch" ]; then
log_info "Arch Linux detected"
if has_command yazi; then
if ! confirm "Yazi is already installed. Reinstall/Upgrade?"; then
log_info "Skipping Yazi installation."
return
fi
else
if ! confirm "Install Yazi and its dependencies?"; then
log_info "Skipping Yazi installation."
return
fi
log_info "Yazi is already installed."
fi
log_info "Installing Yazi..."
@@ -84,15 +76,7 @@ install_yazi() {
elif [ "$distro" = "debian" ]; then
log_info "Debian/Ubuntu detected"
if has_command yazi; then
if ! confirm "Yazi is already installed. Reinstall/Upgrade?"; then
log_info "Skipping Yazi installation."
return
fi
else
if ! confirm "Install Yazi and its dependencies?"; then
log_info "Skipping Yazi installation."
return
fi
log_info "Yazi is already installed."
fi
pkg_install curl wget git
@@ -124,15 +108,7 @@ install_yazi() {
elif [ "$distro" = "fedora" ]; then
log_info "Fedora detected"
if has_command yazi; then
if ! confirm "Yazi is already installed. Reinstall/Upgrade?"; then
log_info "Skipping Yazi installation."
return
fi
else
if ! confirm "Install Yazi and its dependencies?"; then
log_info "Skipping Yazi installation."
return
fi
log_info "Yazi is already installed."
fi
log_info "Installing dnf-plugins-core..."

View File

@@ -42,15 +42,7 @@ install_fzf() {
install_zoxide() {
if has_command zoxide || [ -f "$HOME/.local/bin/zoxide" ]; then
if ! confirm "Zoxide is already installed. Reinstall/Upgrade?"; then
log_info "Skipping Zoxide installation."
return
fi
else
if ! confirm "Install Zoxide?"; then
log_info "Skipping Zoxide installation."
return
fi
log_info "Zoxide is already installed."
fi
install_curl