Skip to content

Commit 7985526

Browse files
committed
⚡️ zoxide
1 parent 7182226 commit 7985526

File tree

4 files changed

+44
-12
lines changed

4 files changed

+44
-12
lines changed

bootstrap/bootstrap.sh

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -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

128124
function 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

372393
dotfiles_ascii
373394
install_dependencies
395+
install_binaries
374396
install_dotfiles
375397
init_submodules
376398
symlink_dotfiles

macos/Brewfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ brew "thefuck"
4747
brew "tree"
4848
brew "wget"
4949
brew "yq"
50+
brew "zoxide"
5051

5152
##########################################################
5253
######################### CASKS ##########################

shell/.bashrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ completions=(
4444
makefile
4545
ssh
4646
uv
47+
zoxide
4748
)
4849
aliases=(
4950
general
@@ -81,6 +82,10 @@ fi
8182
if command -v direnv &>/dev/null; then
8283
eval "$(direnv hook bash)"
8384
fi
85+
# fzf
86+
if command -v fzf &>/dev/null; then
87+
eval "$(fzf --bash)"
88+
fi
8489

8590
#########################################################################################################
8691

shell/.zshrc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ plugins=(
1717
docker
1818
asdf
1919
web-search
20-
z
20+
zoxide
2121
fast-syntax-highlighting
2222
zsh-autosuggestions
2323
zsh-completions
@@ -80,6 +80,10 @@ fi
8080
if command -v direnv &>/dev/null; then
8181
eval "$(direnv hook zsh)"
8282
fi
83+
# fzf
84+
if command -v fzf &>/dev/null; then
85+
source <(fzf --zsh)
86+
fi
8387

8488
# disable autocd
8589
unsetopt autocd

0 commit comments

Comments
 (0)