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() {
|
install_dotfile() {
|
||||||
local dest="$1"
|
local dest="$1"
|
||||||
|
local contents="$2"
|
||||||
|
|
||||||
if [[ -f "$dest" ]]; then
|
if [[ -f "$dest" ]]; then
|
||||||
mv -vi "$dest" "$dest.dmitmel-dotfiles-backup"
|
mv -vi "$dest" "$dest.dmitmel-dotfiles-backup"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p "${dest:h}"
|
mkdir -p "${dest:h}"
|
||||||
cat > "$dest"
|
echo "$contents" > "$dest"
|
||||||
}
|
}
|
||||||
|
|
||||||
# ZSH
|
# ZSH
|
||||||
for zsh_file_name in zshrc; do
|
for zsh_file_name in zshrc; do
|
||||||
install_dotfile "$HOME/.$zsh_file_name" <<EOF
|
install_dotfile "$HOME/.$zsh_file_name" '
|
||||||
#!/usr/bin/env zsh
|
#!/usr/bin/env zsh
|
||||||
source "$PWD/zsh/$zsh_file_name"
|
source "$PWD/zsh/$zsh_file_name"
|
||||||
EOF
|
'
|
||||||
done
|
done
|
||||||
unset zsh_file_name
|
unset zsh_file_name
|
||||||
|
|
||||||
# Neovim
|
# Neovim
|
||||||
install_dotfile ~/.config/nvim/init.vim <<EOF
|
install_dotfile ~/.config/nvim/init.vim 'source $PWD/nvim/init.vim'
|
||||||
source $PWD/nvim/init.vim
|
install_dotfile ~/.config/nvim/ginit.vim 'source $PWD/nvim/ginit.vim'
|
||||||
EOF
|
|
||||||
install_dotfile ~/.config/nvim/ginit.vim <<EOF
|
|
||||||
source $PWD/nvim/ginit.vim
|
|
||||||
EOF
|
|
||||||
|
|
Loading…
Reference in a new issue