2018-02-24 08:53:58 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2019-01-01 23:38:15 +00:00
|
|
|
for zsh_file_name in zshrc; do
|
2018-11-13 06:05:03 +00:00
|
|
|
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
|
2018-11-13 06:05:03 +00:00
|
|
|
zsh_file_backup="$zsh_file.dmitmel-dotfiles-backup"
|
2018-11-09 19:28:28 +00:00
|
|
|
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
|