feat: install fzf for you
1 file changed, +49 -22
+49-22install.sh
| @@ -66,6 +66,7 @@ echo "Ensuring base tools are installed." | ||
| 66 | 66 | if [ -f /etc/debian_version ]; then |
| 67 | 67 | # Set the installer prefix |
| 68 | 68 | installer="$prefix apt-get -y" |
| 69 | + install_cmd="$installer install" | |
| 69 | 70 | |
| 70 | 71 | # Update system |
| 71 | 72 | echop "Detected Debian. Updating and upgrading now!" |
| @@ -77,7 +78,7 @@ if [ -f /etc/debian_version ]; then | ||
| 77 | 78 | |
| 78 | 79 | # Install build essential |
| 79 | 80 | animate "dpkg -s build-essential &>/dev/null" \ |
| 80 | - "$installer install build-essential" \ | |
| 81 | + "$install_cmd build-essential" \ | |
| 81 | 82 | "Installing build-essential" \ |
| 82 | 83 | "build-essential installed" \ |
| 83 | 84 | "Failed to install build-essential" || exit 1 |
| @@ -85,55 +86,74 @@ if [ -f /etc/debian_version ]; then | ||
| 85 | 86 | # Install basic tools for arch |
| 86 | 87 | elif [ -f /etc/arch-release ]; then |
| 87 | 88 | # Set pacman prefix |
| 88 | - installer="$prefix pacman" | |
| 89 | - install_cmd="$installer -S --noconfirm" | |
| 89 | + installer="$prefix pacman --noconfirm" | |
| 90 | + install_cmd="$installer -S" | |
| 90 | 91 | |
| 91 | 92 | # Update system |
| 92 | - echob "Arch Detected. You are elite. Updating and upgrading now!" | |
| 93 | - login_sudo | |
| 94 | - animate "$installer -Syu" | |
| 95 | - echog "✅ System up to date!" | |
| 93 | + echot "Arch Detected. You are elite. Updating and upgrading now!" | |
| 94 | + animate "" \ | |
| 95 | + "$installer -Syu" \ | |
| 96 | + "Updating system" \ | |
| 97 | + "System up to date!" \ | |
| 98 | + "Failed to update system" || exit 1 | |
| 96 | 99 | |
| 97 | 100 | # Install base-devel |
| 98 | - login_sudo | |
| 99 | - pacman -Q base-devel &>/dev/null || | |
| 100 | - { echo "Installing base-devel" && animate "$installer base-devel" && printf "\e[1A\e[2K"; } || | |
| 101 | - { cat /tmp/last_output && echor "Failed to install base-devel"; } | |
| 102 | - echog "✅ base-devel installed" | |
| 101 | + animate "pacman -Q base-devel &>/dev/null" \ | |
| 102 | + "$install_cmd base-devel" \ | |
| 103 | + "Installing base-devel" \ | |
| 104 | + "base-devel installed" \ | |
| 105 | + "Failed to install base-devel" || exit 1 | |
| 106 | + | |
| 107 | + # Install git | |
| 108 | + animate "command -v git &>/dev/null" \ | |
| 109 | + "$install_cmd git" \ | |
| 110 | + "Installing git" \ | |
| 111 | + "git installed" \ | |
| 112 | + "Failed to install git" || exit 1 | |
| 113 | + | |
| 114 | + # Install cargo before paru | |
| 115 | + animate "[ -f ~/.cargo/env ]" \ | |
| 116 | + "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y" \ | |
| 117 | + "Installing cargo" \ | |
| 118 | + "cargo installed" \ | |
| 119 | + "Failed to install cargo" || exit 1 | |
| 103 | 120 | |
| 104 | 121 | # Install paru |
| 105 | - login_sudo | |
| 106 | - command -v paru &>/dev/null || | |
| 107 | - { echo "Installing paru" && animate "git clone https://aur.archlinux.org/paru.git /tmp/paru && | |
| 108 | - cd /tmp/paru && makepkg -si" && printf "\e[1A\e[2K"; } || | |
| 109 | - { cat /tmp/last_output && echor "Failed to install paru"; } | |
| 110 | - echog "✅ paru installed" | |
| 122 | + paru_dir="$(mktemp -d)" | |
| 123 | + # command -v paru &>/dev/null || | |
| 124 | + # { rm -rf $HOME/paru && git clone https://aur.archlinux.org/paru.git $paru_dir && cd $paru_dir && makepkg -si; } || | |
| 125 | + # { exit 1; } | |
| 126 | + animate "command -v paru &>/dev/null" \ | |
| 127 | + "rm -rf $HOME/paru && git clone https://aur.archlinux.org/paru.git $paru_dir && cd $paru_dir && makepkg -si --noconfirm" \ | |
| 128 | + "Installing paru" \ | |
| 129 | + "paru installed" \ | |
| 130 | + "Failed to install paru" || exit 1 | |
| 111 | 131 | fi |
| 112 | 132 | |
| 113 | 133 | # Install zsh |
| 114 | 134 | animate "command -v zsh &>/dev/null" \ |
| 115 | - "$installer install zsh" \ | |
| 135 | + "$install_cmd zsh" \ | |
| 116 | 136 | "Installing zsh" \ |
| 117 | 137 | "zsh installed" \ |
| 118 | 138 | "Failed to install zsh" || exit 1 |
| 119 | 139 | |
| 120 | 140 | # Install curl (crazy but this happens sometimes) |
| 121 | 141 | animate "command -v curl &>/dev/null" \ |
| 122 | - "$installer install curl" \ | |
| 142 | + "$install_cmd curl" \ | |
| 123 | 143 | "Installing curl" \ |
| 124 | 144 | "curl installed" \ |
| 125 | 145 | "Failed to install curl" || exit 1 |
| 126 | 146 | |
| 127 | 147 | # Install unzip |
| 128 | 148 | animate "command -v unzip &>/dev/null" \ |
| 129 | - "$installer install unzip" \ | |
| 149 | + "$install_cmd unzip" \ | |
| 130 | 150 | "Installing unzip" \ |
| 131 | 151 | "unzip installed" \ |
| 132 | 152 | "Failed to install unzip" || exit 1 |
| 133 | 153 | |
| 134 | 154 | # Install git |
| 135 | 155 | animate "command -v git &>/dev/null" \ |
| 136 | - "$installer install git" \ | |
| 156 | + "$install_cmd git" \ | |
| 137 | 157 | "Installing git" \ |
| 138 | 158 | "git installed" \ |
| 139 | 159 | "Failed to install git" || exit 1 |
| @@ -162,6 +182,13 @@ animate "[[ \"$(go version 2>/dev/null | awk '{print $3}')\" == \"$latest_go_ver | ||
| 162 | 182 | "go installed" \ |
| 163 | 183 | "Failed to install go" || exit 1 |
| 164 | 184 | |
| 185 | +# Install fzf (written in go) | |
| 186 | +animate "command -v fzf &>/dev/null" \ | |
| 187 | + "git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf && ~/.fzf/install" \ | |
| 188 | + "Installing fzf" \ | |
| 189 | + "fzf installed" \ | |
| 190 | + "Failed to install fzf" | |
| 191 | + | |
| 165 | 192 | # Install lazygit with go |
| 166 | 193 | animate "command -v lazygit &>/dev/null" \ |
| 167 | 194 | "go install github.com/jesseduffield/lazygit@latest" \ |