may the Force be with you

This commit is contained in:
Bryan Joshua Pedini 2021-06-03 17:44:18 +02:00
parent 8866dc5bec
commit 9851de3007
1 changed files with 7 additions and 4 deletions

View File

@ -2,12 +2,15 @@
THIS="$(dirname "$(readlink -fm "$0")")" THIS="$(dirname "$(readlink -fm "$0")")"
SERVER=FALSE SERVER=FALSE
CLEANUP=false FORCE=FALSE
CLEANUP=FALSE
_arguments() { _arguments() {
for PARM in "$@"; do for PARM in "$@"; do
if [ "${PARM}" = "--server" ]; then if [ "${PARM}" = "--server" ]; then
SERVER=TRUE SERVER=TRUE
elif [ "${PARM}" = "--force" ]; then
FORCE=TRUE
elif [ "${PARM}" = "--cleanup" ]; then elif [ "${PARM}" = "--cleanup" ]; then
CLEANUP=TRUE CLEANUP=TRUE
elif [ "${PARM}" = "-h" ] || [ "${PARM}" = "--help" ]; then elif [ "${PARM}" = "-h" ] || [ "${PARM}" = "--help" ]; then
@ -42,7 +45,7 @@ _cleanup() {
_main() { _main() {
_arguments "$@" _arguments "$@"
if [ ! -z "$(grep "#REF:bashrc_overrides:REF" ~/.bashrc)" ]; then if [ ! -z "$(grep "#REF:bashrc_overrides:REF" ~/.bashrc)" ] && [ "${FORCE}" = FALSE ]; then
echo "bash overrides already in place" echo "bash overrides already in place"
echo "skipping..." echo "skipping..."
echo echo
@ -52,11 +55,11 @@ _main() {
echo echo
fi fi
if [ "${SERVER}" = true ]; then if [ "${SERVER}" = FALSE ]; then
sed -i 's/terminal_fancyfying/terminal_fancyfying_server/' ~/.bashrc_overrides/_all sed -i 's/terminal_fancyfying/terminal_fancyfying_server/' ~/.bashrc_overrides/_all
fi fi
if [ "${CLEANUP}" = true ]; then if [ "${CLEANUP}" = FALSE ]; then
echo "cleaning up..." echo "cleaning up..."
_cleanup _cleanup
fi fi