This commit is contained in:
2026-07-10 15:11:51 +08:00
parent 8bfcf23bc2
commit da17239d7d
148 changed files with 2542 additions and 4873 deletions
+62 -12
View File
@@ -1,19 +1,69 @@
#!/usr/bin/env bash
##makedesc: Install omz (latest)
echo
echo "==============================================="
echo "Installing omz (latest)..."
echo "==============================================="
echo
set -eo pipefail
installed() {
command -v "$1" >/dev/null 2>&1
installed() { command -v "$1" >/dev/null 2>&1; }
install() {
echo
echo "==============================================="
echo "Installing omz"
echo "==============================================="
echo
if ! installed zsh || ! installed git || ! installed curl; then
echo "ERROR: you need git, zsh and curl to be installed!" >&2
exit 1
fi
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
echo
echo "Finish!"
echo
}
if ! installed zsh || ! installed git || ! installed curl; then
echo "ERROR: you need git, zsh and curl to be installed!"
exit 1
fi
upgrade() {
echo
echo "==============================================="
echo "Upgrading omz"
echo "==============================================="
echo
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
if [ -d "$ZSH" ]; then
bash "$ZSH/tools/upgrade.sh"
else
echo "ERROR: OMZ not found." >&2
exit 1
fi
echo
echo "Finish!"
echo
}
remove() {
echo
echo "==============================================="
echo "Removing omz"
echo "==============================================="
echo
if [ -d "$ZSH" ]; then
bash "$ZSH/tools/uninstall.sh"
else
echo "WARNING: OMZ not found, cleaning up." >&2
fi
rm -rf "$HOME/.oh-my-zsh"
echo
echo "Finish!"
echo
}
case "$1" in
u|upgrade|update) upgrade ;;
r|remove|d|delete|p|purge) remove ;;
*) install ;;
esac