-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall
executable file
·43 lines (31 loc) · 1.1 KB
/
install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env bash
export CONFIGS_DIR=~/configs
export PATH="$PATH:$HOME/bin"
export MISE_INSTALL_PATH=$HOME/bin/mise
function explain() {
echo ""
echo "#######################################################"
echo ""
echo "Installation complete. Open a new Terminal."
echo ""
echo "To sync config to the latest commit run: sync"
echo ""
echo "#######################################################"
echo ""
}
function install_zshrc() {
echo "# luckydye configs" >> ~/.zshrc || exit 1
echo "source $CONFIGS_DIR/.zshrc" >> ~/.zshrc || exit 1
}
function install_ssh_config() {
echo "# luckydye configs" >> ~/.ssh/config || exit 1
echo "Include ~/.ssh/config_configs" >> ~/.ssh/config || exit 1
}
git clone https://github.com/luckydye/configs.git ${CONFIGS_DIR}
# install task
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b $HOME/bin || exit 1
grep -Fxq "# luckydye configs" ~/.zshrc || install_zshrc
grep -Fxq "# luckydye configs" ~/.ssh/config || install_ssh_config
source $CONFIGS_DIR/.zshrc || exit 1
task -t $CONFIGS_DIR/setup.yml || exit 1
explain