irongit

feat: install fzf for you

huncholanehuncholaneauthored
parent 7c3e538commit 215b8f541da61b147ca2985bb20acd9619a4dbcdBrowse files

1 file changed, +49 -22

+49-22install.sh
@@ -66,6 +66,7 @@ echo "Ensuring base tools are installed."
6666 if [ -f /etc/debian_version ]; then
6767 # Set the installer prefix
6868 installer="$prefix apt-get -y"
69+ install_cmd="$installer install"
6970
7071 # Update system
7172 echop "Detected Debian. Updating and upgrading now!"
@@ -77,7 +78,7 @@ if [ -f /etc/debian_version ]; then
7778
7879 # Install build essential
7980 animate "dpkg -s build-essential &>/dev/null" \
80- "$installer install build-essential" \
81+ "$install_cmd build-essential" \
8182 "Installing build-essential" \
8283 "build-essential installed" \
8384 "Failed to install build-essential" || exit 1
@@ -85,55 +86,74 @@ if [ -f /etc/debian_version ]; then
8586 # Install basic tools for arch
8687 elif [ -f /etc/arch-release ]; then
8788 # Set pacman prefix
88- installer="$prefix pacman"
89- install_cmd="$installer -S --noconfirm"
89+ installer="$prefix pacman --noconfirm"
90+ install_cmd="$installer -S"
9091
9192 # 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
9699
97100 # 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
103120
104121 # 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
111131 fi
112132
113133 # Install zsh
114134 animate "command -v zsh &>/dev/null" \
115- "$installer install zsh" \
135+ "$install_cmd zsh" \
116136 "Installing zsh" \
117137 "zsh installed" \
118138 "Failed to install zsh" || exit 1
119139
120140 # Install curl (crazy but this happens sometimes)
121141 animate "command -v curl &>/dev/null" \
122- "$installer install curl" \
142+ "$install_cmd curl" \
123143 "Installing curl" \
124144 "curl installed" \
125145 "Failed to install curl" || exit 1
126146
127147 # Install unzip
128148 animate "command -v unzip &>/dev/null" \
129- "$installer install unzip" \
149+ "$install_cmd unzip" \
130150 "Installing unzip" \
131151 "unzip installed" \
132152 "Failed to install unzip" || exit 1
133153
134154 # Install git
135155 animate "command -v git &>/dev/null" \
136- "$installer install git" \
156+ "$install_cmd git" \
137157 "Installing git" \
138158 "git installed" \
139159 "Failed to install git" || exit 1
@@ -162,6 +182,13 @@ animate "[[ \"$(go version 2>/dev/null | awk '{print $3}')\" == \"$latest_go_ver
162182 "go installed" \
163183 "Failed to install go" || exit 1
164184
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+
165192 # Install lazygit with go
166193 animate "command -v lazygit &>/dev/null" \
167194 "go install github.com/jesseduffield/lazygit@latest" \