mirror of
https://github.com/keanuplayz/dotfiles.git
synced 2024-08-15 02:33:12 +00:00
fix installation script
This commit is contained in:
parent
f46e58fd3a
commit
4fb5bc69ff
1 changed files with 6 additions and 9 deletions
15
install.zsh
15
install.zsh
|
@ -2,28 +2,25 @@
|
|||
|
||||
install_dotfile() {
|
||||
local dest="$1"
|
||||
local contents="$2"
|
||||
|
||||
if [[ -f "$dest" ]]; then
|
||||
mv -vi "$dest" "$dest.dmitmel-dotfiles-backup"
|
||||
fi
|
||||
|
||||
mkdir -p "${dest:h}"
|
||||
cat > "$dest"
|
||||
echo "$contents" > "$dest"
|
||||
}
|
||||
|
||||
# ZSH
|
||||
for zsh_file_name in zshrc; do
|
||||
install_dotfile "$HOME/.$zsh_file_name" <<EOF
|
||||
install_dotfile "$HOME/.$zsh_file_name" '
|
||||
#!/usr/bin/env zsh
|
||||
source "$PWD/zsh/$zsh_file_name"
|
||||
EOF
|
||||
'
|
||||
done
|
||||
unset zsh_file_name
|
||||
|
||||
# Neovim
|
||||
install_dotfile ~/.config/nvim/init.vim <<EOF
|
||||
source $PWD/nvim/init.vim
|
||||
EOF
|
||||
install_dotfile ~/.config/nvim/ginit.vim <<EOF
|
||||
source $PWD/nvim/ginit.vim
|
||||
EOF
|
||||
install_dotfile ~/.config/nvim/init.vim 'source $PWD/nvim/init.vim'
|
||||
install_dotfile ~/.config/nvim/ginit.vim 'source $PWD/nvim/ginit.vim'
|
||||
|
|
Loading…
Reference in a new issue