X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=scripts%2Fcore%2Ffunctions.sh;h=9674e3b3eec672239dddeb77635428a46e1de35e;hb=78f64aac6aa23781a597cb74d96d5446d28964dd;hp=aa9c512a918cfa91703226c4f77a1efe413b85d4;hpb=c041a073fe44baafa4ebcb516c7d377d52fff054;p=feisty_meow.git diff --git a/scripts/core/functions.sh b/scripts/core/functions.sh index aa9c512a..9674e3b3 100644 --- a/scripts/core/functions.sh +++ b/scripts/core/functions.sh @@ -32,7 +32,18 @@ if [ -z "$skip_all" ]; then if [ ! -d "$1" ]; then mkdir -p "$1"; fi cd "$1" } - + + # checks the result of the last command that was run, and if it failed, + # then this complains and exits from bash. the function parameters are + # used as the message to print as a complaint. + function check_result() + { + if [ $? -ne 0 ]; then + echo -e "failed on: $*" + exit 1 + fi + } + # locates a process given a search pattern to match in the process list. function psfind() { local PID_DUMP="$(mktemp "$TMP/zz_pidlist.XXXXXX")" @@ -264,6 +275,27 @@ if [ -z "$skip_all" ]; then echo } + # copies a set of custom scripts into the proper location for feisty meow + # to merge their functions and aliases with the standard set. + function recustomize() + { + user="$1"; shift + if [ -z "$user" ]; then + # use our default example user if there was no name provided. + user=fred + fi + if [ ! -d "$FEISTY_MEOW_DIR/customizing/$user" ]; then + echo "The customization folder provided for $user should be:" + echo " '$FEISTY_MEOW_DIR/customizing/$user'" + echo "but that folder does not exist. Skipping customization." + return 1 + fi + regenerate >/dev/null + echo "copying custom overrides for $user" + perl "$FEISTY_MEOW_SCRIPTS/text/cpdiff.pl" "$FEISTY_MEOW_DIR/customizing/$user" "$FEISTY_MEOW_GENERATED/custom" + regenerate + } + function function_sentinel() { return 0; } if [ ! -z "$SHELL_DEBUG" ]; then echo function definitions end....; fi