dotar/install.sh

39 lines
735 B
Bash
Raw Permalink Normal View History

2018-12-31 12:04:55 +08:00
#!/bin/bash
exists () {
which $1 &> /dev/null; echo $?
}
2018-12-31 12:04:55 +08:00
install () {
pkg=$1
cmd=$2
if [ -z "$2" ]; then
cmd=$pkg
fi
if [ `exists $cmd` != "0" ]; then
if [ "$(uname)" = "Darwin" ]; then
2018-12-31 12:04:55 +08:00
brew install $pkg
elif [ "$(expr substr $(uname -s) 1 5)" = "Linux" ]; then
2018-12-31 12:04:55 +08:00
sudo apt install $pkg -y
fi
fi
2018-12-31 12:04:55 +08:00
}
install fontconfig fc-cache
2018-12-31 12:13:59 +08:00
tools=("zsh" "git" "rake" "tmux")
2018-12-31 12:04:55 +08:00
for tool in "${tools[@]}"; do
install $tool
done
if [ ! -d "$HOME/.yadr" ]; then
echo "Installing YADR for the first time"
2024-12-05 10:52:20 +08:00
git clone --depth=1 https://git.bitnet.fun/Gaze/dotar.git "$HOME/.yadr"
cd "$HOME/.yadr"
2014-04-02 02:53:49 +08:00
[ "$1" = "ask" ] && export ASK="true"
rake install
else
echo "YADR is already installed"
fi