@@ -114,16 +114,12 @@ DEPENDENCIES=(
114114 make
115115)
116116
117- function install_starship() {
118- if [[ $( uname) == " Linux" ]]; then
119- log_event " info" " Installing ${PURPLE} starship${NO_COLOR} with ${BLUE} curl${NO_COLOR} 🚀"
120- curl -sS https://starship.rs/install.sh | sh -s -- --yes & > /dev/null &
121- spinner || log_event " error" " Failed to install ${PURPLE} starship${NO_COLOR} with ${BLUE} curl${NO_COLOR} "
122- elif [[ $( uname) == " Darwin" ]]; then
123- log_event " info" " Installing ${PURPLE} starship${NO_COLOR} with ${BLUE} brew${NO_COLOR} 🚀"
124- brew install starship
125- fi
126- }
117+ if [[ $( uname) == " Darwin" ]]; then
118+ DEPENDENCIES+=(
119+ starship
120+ zoxide
121+ )
122+ fi
127123
128124function install_dependencies() {
129125 local package
@@ -202,7 +198,32 @@ function install_dependencies() {
202198 pacman --sync --refresh --noconfirm " ${packages_to_install[@]} " & > /dev/null &
203199 spinner || log_event " error" " Failed to install ${PURPLE}${packages_to_install[@]}${NO_COLOR} with ${BLUE}${PACKAGE_MANAGER}${NO_COLOR} "
204200 fi
205- install_starship
201+ }
202+
203+ # ##########################
204+ # Install a Binary from URL
205+ # ##########################
206+ function install_binary() {
207+ local binary_name=${1}
208+ local binary_url=${2}
209+ local args=(" ${@: 3} " )
210+ # exit early if the binary is already installed
211+ if command -v " ${binary_name} " & > /dev/null; then
212+ return 0
213+ fi
214+ log_event " info" " Installing ${PURPLE}${binary_name}${NO_COLOR} with ${BLUE} curl${NO_COLOR} 📦"
215+ curl -sSfL " ${binary_url} " | sh -s -- ${args[@]} & > /dev/null &
216+ spinner || log_event " error" " Failed to install ${PURPLE}${binary_name}${NO_COLOR} with ${BLUE} curl${NO_COLOR} "
217+ }
218+
219+ # ##########################
220+ # Install Binary Deps
221+ # ##########################
222+ function install_binaries() {
223+ if [[ $( uname) == " Linux" ]]; then
224+ install_binary starship " https://starship.rs/install.sh" " --yes"
225+ install_binary zoxide " https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh"
226+ fi
206227}
207228
208229# #########################################################
@@ -371,6 +392,7 @@ function symlink_dotfiles() {
371392
372393dotfiles_ascii
373394install_dependencies
395+ install_binaries
374396install_dotfiles
375397init_submodules
376398symlink_dotfiles
0 commit comments