dotfiles/install.sh

18 lines
380 B
Bash
Raw Normal View History

2018-02-24 08:53:58 +00:00
#!/usr/bin/env bash
2018-11-09 19:28:28 +00:00
for zsh_file_name in z{shenv,shrc,login}; do
zsh_file="${HOME}/.${zsh_file_name}"
2018-08-23 09:40:09 +00:00
2018-11-09 19:28:28 +00:00
if [[ -f "$zsh_file" ]]; then
zsh_file_backup="${zsh_file}.dmitmel-dotfiles-backup"
echo "Backing up $zsh_file to $zsh_file_backup"
mv -vi "$zsh_file" "$zsh_file_backup"
fi
2018-08-23 09:40:09 +00:00
2018-11-09 19:28:28 +00:00
cat > "$zsh_file" <<EOF
2018-08-23 09:40:09 +00:00
#!/usr/bin/env zsh
2018-11-10 14:51:47 +00:00
source "$PWD/$zsh_file_name"
2018-08-23 09:40:09 +00:00
EOF
2018-11-09 19:28:28 +00:00
done