-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathal_install.sh
34 lines (29 loc) · 1021 Bytes
/
al_install.sh
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
#!/usr/bin/env bash
set -xue
rm -rf ~/.fzf
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install --all
link_to_homedir() {
command echo "backup old dotfiles..."
if [ ! -d "$HOME/.dotbackup" ];then
command echo "$HOME/.dotbackup not found. Auto Make it"
command mkdir "$HOME/.dotbackup"
fi
local script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd )"
for dotfile in $script_dir/.??* ; do
[[ `basename $dotfile` == ".git" ]] && continue
[[ `basename $dotfile` == ".github" ]] && continue
[[ `basename $dotfile` == ".devcontainer" ]] && continue
[[ `basename $dotfile` == ".gitconfig" ]] && continue
if [[ -L "$HOME/`basename $dotfile`" ]];then
command rm -f "$HOME/`basename $dotfile`"
fi
if [[ -e "$HOME/`basename $dotfile`" ]];then
command mv "$HOME/`basename $dotfile`" "$HOME/.dotbackup"
fi
command ln -snf $dotfile $HOME
echo $dotfile
done
}
link_to_homedir
command echo -e "\e[1;36m Install completed!!!! \e[m"