From 1f20ce659deb3347452b208c86ed7cc248519a5b Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Fri, 3 Nov 2017 11:06:30 -0400 Subject: [PATCH] tasty new script for adding feisty meow this configures .bashrc to use the normal user feisty init script. it eliminates the step of having to edit .bashrc to get up and running, although there is still an inappropriate default NAME variable being set in there. --- scripts/core/connect_feisty_meow.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 scripts/core/connect_feisty_meow.sh diff --git a/scripts/core/connect_feisty_meow.sh b/scripts/core/connect_feisty_meow.sh new file mode 100644 index 00000000..6b235793 --- /dev/null +++ b/scripts/core/connect_feisty_meow.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# Author: Chris Koeritz + +# 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. +# normalize the path we want to cobble together. +export FEISTY_MEOW_APEX="$( \cd "$WORKDIR/../.." && \pwd )" + +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/feisty_inits/dot.bashrc-normal-user | + sed -e \ + "s? \$.*/scripts/core/launch_feisty? $FEISTY_MEOW_APEX/scripts/core/launch_feisty?" \ + >> "$HOME/.bashrc" + echo "Feisty Meow is now configured in '~/.bashrc'." +fi + -- 2.34.1