added forced update method, do not use now (UNTESTED)

This commit is contained in:
Bryan Joshua Pedini 2021-08-15 14:44:02 +02:00
parent 627282b2cc
commit a4885fa060

View File

@ -37,6 +37,9 @@ _help() {
_bash_overrides() {
cp -r bashrc_overrides ~/.bashrc_overrides
}
_bashrc_ref() {
echo "#REF:bashrc_overrides:REF" >> ~/.bashrc
echo "if [ -f ~/.bashrc_overrides/_all ]; then" >> ~/.bashrc
echo " . ~/.bashrc_overrides/_all" >> ~/.bashrc
@ -50,12 +53,15 @@ _cleanup() {
_main() {
_arguments "$@"
if [ ! -z "$(grep "#REF:bashrc_overrides:REF" ~/.bashrc)" ] && [ "${FORCE}" = false ]; then
if [ "${FORCE}" = true ]; then
_bash_overrides
elif [ ! -z "$(grep "#REF:bashrc_overrides:REF" ~/.bashrc)" ]; then
echo "bash overrides already in place"
echo "skipping..."
echo
else
_bash_overrides
_bashrc_ref
echo "bash overrides added"
echo
fi