this commit adds a lot of shit, look at the shit, too much sorry

Signed-off-by: Menno van Leeuwen <menno@vleeuwen.me>
This commit is contained in:
2024-08-24 01:35:46 +02:00
parent 379b1b97ec
commit 183b688617
52 changed files with 580 additions and 453 deletions

28
bin/helpers/ohmyzsh.sh Executable file
View File

@@ -0,0 +1,28 @@
#!/usr/bin/env zsh
source ~/dotfiles/bin/helpers/functions.sh
ensure_ohmyzsh_installed() {
if [ -d ~/.oh-my-zsh ]; then
printfe "%s" "yellow" " - Updating Oh My Zsh..."
echo -en "\r"
zstyle ':omz:update' verbose minimal
result=$($ZSH/tools/upgrade.sh)
if [ $? -ne 0 ]; then
printfe "%s\n" "red" "Failed to update Oh My Zsh"
exit 1
fi
# if result contains "already at the latest version" then it's already up to date and we should say so
if [[ $result == *"already at the latest version"* ]]; then
printfe "%s\n" "green" " - Oh My Zsh is already up to date"
else
printfe "%s\n" "green" " - Oh My Zsh updated successfully"
printfe "%s\n" "green" "$result"
fi
else
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
fi
}