X-Git-Url: https://feistymeow.org/gitweb/?p=feisty_meow.git;a=blobdiff_plain;f=scripts%2Fcore%2Floadfm.sh;fp=scripts%2Fcore%2Floadfm.sh;h=8911b4610107345c3afe3c14a16089954beb598f;hp=0000000000000000000000000000000000000000;hb=8d1f8f686d8b7f306d9f8ed36561f553c609acc0;hpb=5a50577a77e5fc03099475ca5ffe3122659ab54c diff --git a/scripts/core/loadfm.sh b/scripts/core/loadfm.sh new file mode 100755 index 00000000..8911b461 --- /dev/null +++ b/scripts/core/loadfm.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash + +# this is a simplified feisty meow environment loader that starts +# a subshell within which the environment is available. exiting +# one time gets back to the shell that ran this script. (this script +# is designed to be executed, not sourced.) + +# Author: Chris Koeritz + +ORIGINATING_FOLDER="$( \cd "$(\dirname "$0")" && /bin/pwd )" +export CORE_SCRIPTS_DIR="$(echo "$ORIGINATING_FOLDER" | tr '\\\\' '/' )" +echo core scripts dir is $CORE_SCRIPTS_DIR + +THIS_TOOL_NAME="$(basename "$0")" + +pushd "$CORE_SCRIPTS_DIR/../.." &>/dev/null +export FEISTY_MEOW_APEX="$(/bin/pwd)" +echo feisty apex is now FEISTY_MEOW_APEX=$FEISTY_MEOW_APEX + +#hmmm: actually this should run the reconfigure script first! +# then we would be semi-bulletproof and wouldn't actually have +# to make users run that as first step? + +bash --init-file <(echo "\ +echo "subshell sees feisty meow apex as $FEISTY_MEOW_APEX"; \ +bash "$CORE_SCRIPTS_DIR/reconfigure_feisty_meow.sh"; \ +if [ $? -ne 0 ]; then echo "error--reconfiguring feisty meow environment failed."; fi; \ +source "$CORE_SCRIPTS_DIR/launch_feisty_meow.sh"; \ +if [ $? -ne 0 ]; then echo "error--launching feisty meow environment failed."; fi; \ +") + +popd &> /dev/null + +#### +