template_setup/03-Checking_Custom_Bash_Aliases.sh
deathbybandaid 9bb77cfcd1 test
2022-03-12 15:19:05 -05:00

29 lines
738 B
Bash

#!/bin/bash
## Script Location
SCRIPTDIR=$(dirname $0)
source "$SCRIPTDIR/common/functions.sh"
BASHRCFILE="$HOME/.bashrc"
custom_bash_aliases_path="/etc/bash_aliases"
custom_bash_aliases_git="https://git.deathbybandaid.net/deathbybandaid/bash_aliases.git"
git_update "topgrade" "$custom_bash_aliases_path" "$custom_bash_aliases_git"
echo "* Checking if bash aliases are setup in ~/.bashrc"
if [[ $(grep -L "$custom_bash_aliases_path" $BASHRCFILE) ]]; then
echo "** Linking bash aliases"
cat <<EOT >> $BASHRCFILE
# Aliases
if [ -f $custom_bash_aliases_path/main.aliases ]; then
. $custom_bash_aliases_path/main.aliases
fi
EOT
else
echo "** bash aliases already linked"
fi
echo "* Importing Bash Aliases"
source $BASHRCFILE