Advertisement
Guest User

Untitled

a guest
Feb 26th, 2020
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.52 KB | None | 0 0
  1. #!/usr/bin/env bash
  2. set -x
  3. if [ "$(readlink -f "$(basename "$0")")" = "${HOME}/.config/bash/init.sh" ]; then
  4.    for config in 'bash_profile' 'bashrc'; do
  5.        if [ -f "${HOME}/.${config}" ]; then
  6.            mv "${HOME}/.${config}" "${HOME}/.${config}.bak"
  7.            ln -s "${HOME}/.config/bash/${config}" "${HOME}/.${config}"
  8.        fi
  9.    done
  10. else echo -e "Not in the correct working directory! You should clone/extract "bash_config" to the directory ~/.config/bash, and run this script from there!" && exit 1;
  11. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement