forked from flat235/dotfiles-flat235
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.sh
37 lines (31 loc) · 979 Bytes
/
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
35
36
#!/bin/bash
# vim: sw=4 et
set -e
condition_for_install=1
if [[ \
-f $(which git 2>/dev/null) && \
-f $(which zsh 2>/dev/null) && \
-f $(which python3 2>/dev/null)
]]; then
condition_for_install=0
fi
if [[ ${condition_for_install} -eq 0 ]]; then
pushd "$HOME" >/dev/null
mkdir -pv "$HOME/bin"
echo "git clone https://git.compilenix.org/CompileNix/dotfiles.git \"$HOME/dotfiles\""
git clone https://git.compilenix.org/CompileNix/dotfiles.git "$HOME/dotfiles"
pushd "$HOME/dotfiles" >/dev/null
./update.sh
popd >/dev/null
if [[ $EUID -eq 0 ]]; then
chsh -s /bin/zsh
else
echo "you are not root, so you are not allowed to change your own shell to zsh"
echo 'retry with: sudo chsh -s /bin/zsh "$USER"'
fi
popd >/dev/null
else
echo "one or more of the following dependencies are not installed: git, zsh, python3"
exit 1
fi
set +e