Fixed subroutines
This commit is contained in:
parent
6a1788d3bf
commit
a063527886
@ -9,7 +9,7 @@
|
||||
# create the temporary script
|
||||
script=/tmp/install-script
|
||||
cat > $script << 'EOL'
|
||||
# change behaviour of bash
|
||||
# change behavior of bash
|
||||
set -e
|
||||
|
||||
# configure vim
|
||||
@ -24,12 +24,16 @@ configure-vim() {
|
||||
|
||||
# install fzf
|
||||
install-fzf() {
|
||||
[ ! -d ~/.fzf ]&& cd ~ && git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf && ~/.fzf/install
|
||||
if [ ! -d ~/.fzf ]; then
|
||||
cd ~ && git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf && ~/.fzf/install
|
||||
else
|
||||
echo "fzf is already installed for $(id)"
|
||||
fi
|
||||
}
|
||||
|
||||
# install oh-my-zsh
|
||||
install-ohmyzsh() {
|
||||
[ ! -d ~/.oh-my-zsh ] && (
|
||||
if [ ! -d ~/.oh-my-zsh ]; then
|
||||
# install oh-my-zsh
|
||||
git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
|
||||
cp ~/.zshrc ~/.zshrc.orig
|
||||
@ -43,7 +47,9 @@ install-ohmyzsh() {
|
||||
if [[ $EUID -ne 0 ]]; then
|
||||
grep "ZSH_TMUX_AUTOSTART" ~/.zshrc || sed -i -- '1s/^/ZSH_TMUX_AUTOSTART="true"\nZSH_TMUX_AUTOQUIT="false"\n\n/' ~/.zshrc
|
||||
fi
|
||||
)
|
||||
else
|
||||
echo "oh-my-zsh is already installed for $(id)"
|
||||
fi
|
||||
}
|
||||
|
||||
# call target function depending of the arguments
|
||||
@ -52,7 +58,7 @@ exit 0
|
||||
EOL
|
||||
chmod +x $script
|
||||
|
||||
# change behaviour of bash
|
||||
# change behavior of bash
|
||||
set -e
|
||||
|
||||
# check if root
|
||||
|
Loading…
Reference in New Issue
Block a user