X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Fcore%2Fconnect_feisty_meow.sh;h=211bba7b975b06a7fe74da328e71d2e0cfceb8e4;hb=2e93c29a45ae9d58694c0de962151e6829739380;hp=9a5c81d548bb3b98b6b22e36a3009641f6cdb868;hpb=d386e463f2cfb9c029fa2a12de947a4858571807;p=feisty_meow.git diff --git a/scripts/core/connect_feisty_meow.sh b/scripts/core/connect_feisty_meow.sh index 9a5c81d5..211bba7b 100644 --- a/scripts/core/connect_feisty_meow.sh +++ b/scripts/core/connect_feisty_meow.sh @@ -5,22 +5,39 @@ # this script adds the feisty inits code to .bashrc, if we think it has not yet been added. # auto-locate the feisty meow scripts, since they supposedly are not enabled yet. -export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )" # obtain the script's working directory. +export THISDIR="$( \cd "$(\dirname "$0")" && \pwd )" # obtain the script's working directory. # normalize the path we want to cobble together. -export FEISTY_MEOW_APEX="$( \cd "$WORKDIR/../.." && \pwd )" +export FEISTY_MEOW_APEX="$( \cd "$THISDIR/../.." && \pwd )" echo calculated apex as $FEISTY_MEOW_APEX +do_root="$1"; shift + if [ -f "$HOME/.bashrc" ] && grep -q "launch_feisty_meow.sh" "$HOME/.bashrc"; then # the stanza for loading feisty meow already seems to be present. echo "Feisty Meow already seems to be configured in '~/.bashrc'." else - # stuff the normal user init file into .bashrc. not appropriate for root probably, but - # this is the easy quick start script for normal folks. - cat $FEISTY_MEOW_APEX/infobase/feisty_inits/dot.bashrc-normal-user | - sed -e \ - "s?FEISTY_MEOW_APEX=\".*\"?FEISTY_MEOW_APEX=\"$FEISTY_MEOW_APEX\"?" \ - >> "$HOME/.bashrc" - echo "Feisty Meow is now configured in '~/.bashrc'." + # check for the --root flag to see if they're trying to get the root version of inits. + if [ "$do_root" != "--root" ]; then + # stuff the "normal user" init file into .bashrc. not appropriate for root. + # this is the easy and quick start script for most folks. + cat $FEISTY_MEOW_APEX/infobase/feisty_inits/dot.bashrc-normal-user | + sed -e \ + "s?FEISTY_MEOW_APEX=\".*\"?FEISTY_MEOW_APEX=\"$FEISTY_MEOW_APEX\"?" \ + >> "$HOME/.bashrc" + echo "Feisty Meow is now configured in '~/.bashrc' for standard users." + else + # stuff the root user init file into .bashrc. this one doesn't + # automatically load the feisty meow scripts. instead, there is a macro + # (uhh, an alias) that loads the feisty meow scripts. the 'fredme' macro + # comes from the main author of feisty meow, named fred t. hamster. we + # have since added a 'feistyme' macro too, to be slightly less + # idiosyncratic, as if that were possible. + cat $FEISTY_MEOW_APEX/infobase/feisty_inits/dot.bashrc-root | + sed -e \ + "s?FEISTY_MEOW_APEX=\".*\"?FEISTY_MEOW_APEX=\"$FEISTY_MEOW_APEX\"?" \ + >> "$HOME/.bashrc" + echo "Feisty Meow is now configured in '~/.bashrc' for the root user." + fi fi