Merge branch 'release-2.140.93'
[feisty_meow.git] / scripts / core / connect_feisty_meow.sh
1 #!/bin/bash
2
3 # Author: Chris Koeritz
4
5 # this script adds the feisty inits code to .bashrc, if we think it has not yet been added.
6
7 # auto-locate the feisty meow scripts, since they supposedly are not enabled yet.
8 export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's working directory.
9 # normalize the path we want to cobble together.
10 export FEISTY_MEOW_APEX="$( \cd "$WORKDIR/../.." && \pwd )"
11
12 echo calculated apex as $FEISTY_MEOW_APEX
13
14 if [ -f "$HOME/.bashrc" ] && grep -q "launch_feisty_meow.sh" "$HOME/.bashrc"; then
15   # the stanza for loading feisty meow already seems to be present.
16   echo "Feisty Meow already seems to be configured in '~/.bashrc'."
17 else
18   # stuff the normal user init file into .bashrc.  not appropriate for root probably, but
19   # this is the easy quick start script for normal folks.
20   cat $FEISTY_MEOW_APEX/infobase/feisty_inits/dot.bashrc-normal-user |
21     sed -e \
22       "s?FEISTY_MEOW_APEX=\".*\"?FEISTY_MEOW_APEX=\"$FEISTY_MEOW_APEX\"?" \
23       >> "$HOME/.bashrc"
24   echo "Feisty Meow is now configured in '~/.bashrc'."
25 fi
26