lazy/run.sh
2023-11-30 14:25:42 +08:00

39 lines
1.3 KiB
Bash
Executable File

#!/bin/sh
if [ "$1" = "command" ]; then
echo "Please run the following command to install lazy:"
echo "sh -c \"\$(wget -qO- cc.c-4.cc/lazy.sh)\""
exit 0
fi
scriptdir=$(dirname $(realpath $0))
# ============================================================
git -C $scriptdir pull
update_file $scriptdir/files/zsh/00-init.zsh ~/.oh-my-zsh/custom/00-init.zsh
update_file $scriptdir/files/zsh/10-theme.zsh ~/.oh-my-zsh/custom/10-theme.zsh
update_file $scriptdir/files/zsh/20-function.zsh ~/.oh-my-zsh/custom/20-function.zsh
update_file $scriptdir/files/zsh/50-alias.zsh ~/.oh-my-zsh/custom/50-alias.zsh
update_file $scriptdir/files/zsh/80-env.zsh ~/.oh-my-zsh/custom/80-env.zsh
update_file $scriptdir/files/zsh/81-proxy.zsh ~/.oh-my-zsh/custom/81-proxy.zsh
update_file $scriptdir/files/zsh/90-other.zsh ~/.oh-my-zsh/custom/90-other.zsh
update_file $scriptdir/files/zsh/ys-simple.zsh-theme ~/.oh-my-zsh/custom/themes/ys-simple.zsh-theme
update_authorized_keys
if [ "$1" = "update" ]; then
exit 0
fi
if [ "$(id -u)" -eq 0 ]; then
echo "Running in root mode."
$scriptdir/init_root.sh $@
elif [ "$(sudo id -u)" -eq 0 ]; then
echo "Running in sudo mode."
$scriptdir/init_sudo.sh $@
else
echo "Running in user mode."
$scriptdir/init_user.sh $@
fi