-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·53 lines (43 loc) · 1.17 KB
/
setup.sh
File metadata and controls
executable file
·53 lines (43 loc) · 1.17 KB
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
44
45
46
47
48
49
50
51
52
#!/bin/bash
DOTFILES_ROOT=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
DOTFILES=($(find ${DOTFILES_ROOT} -mindepth 1 -maxdepth 1 -not -path '*/.*' -type f -exec printf "%s\n" {} + | awk -F/ '{print $NF}'))
DOTFILES_BIN_PATH=${DOTFILES_ROOT}/bin/
BIN_PATH={$HOME}/.local/bin/
for dotfile in "${DOTFILES[@]}"
do
if [[ "${dotfile}" != "setup.sh" ]] && [[ "${dotfile}" != "README.md" ]];
then
if [ -f ~/."${dotfile}" ]
then
printf "~/.${dotfile} exists\n"
else
ln -s "${DOTFILES_ROOT}"/"${dotfile}" ~/."${dotfile}"
printf "~/.${dotfile} linked\n"
fi
fi
done
if [[ -d ~/.oh-my-zsh ]]; then
if [ -L ~/.oh-my-zsh/custom/themes ]
then
printf "\nCustom theme path exists\n\n"
else
ln -s "${DOTFILES_ROOT}"/"oh-my-zsh/themes" ~/.oh-my-zsh/custom/themes
printf "\nLinked custom themes path\n\n"
fi
fi
printf "Setup dotfiles (alias)\n"
for bin in "${DOTFILES_BIN_PATH}"*;
do
file=$(basename $bin)
if [[ "${file}" != "README.md" ]]
then
if [ -f ${BIN_PATH}"${bin}" ]
then
printf ${bin} exists\n
else
ln -s ${bin} ${BIN_PATH}${file}
printf "${file} linked\n"
fi
fi
done
printf "%s installation end\n"