# checks the result of the last command that was run, and if that failed,
# then this complains and exits from bash. the function parameters are
# used as the message to print as a complaint.
# checks the result of the last command that was run, and if that failed,
# then this complains and exits from bash. the function parameters are
# used as the message to print as a complaint.
- # like test_or_die, but will keep going after complaining.
- function test_or_continue()
+ # like exit_on_error, but will keep going after complaining.
+ function continue_on_error()
unalias CORE_ALIASES_LOADED &>/dev/null
unset -f function_sentinel
# reload feisty meow environment in current shell.
unalias CORE_ALIASES_LOADED &>/dev/null
unset -f function_sentinel
# reload feisty meow environment in current shell.
source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
# run nechung oracle to give user a new fortune.
nechung
source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
# run nechung oracle to give user a new fortune.
nechung
local custom_user="$1"; shift
if [ -z "$custom_user" ]; then
# use our default example user if there was no name provided.
local custom_user="$1"; shift
if [ -z "$custom_user" ]; then
# use our default example user if there was no name provided.
- echo "The customization folder provided for $custom_user should be:"
- echo " '$FEISTY_MEOW_SCRIPTS/customize/$custom_user'"
- echo "but that folder does not exist. Skipping customization."
+ echo "The customization folder for '$custom_user' would be:"
+ echo " $FEISTY_MEOW_SCRIPTS/customize/$custom_user"
+ echo "but that folder does not exist. Skipping recustomization."
#hmmm: better yet actually, just don't complain on freaking cygwin, since that's where this happens
chown -R "$(logname):$(logname)" \
"$FEISTY_MEOW_LOADING_DOCK"/* "$FEISTY_MEOW_GENERATED_STORE"/* 2>/dev/null
#hmmm: better yet actually, just don't complain on freaking cygwin, since that's where this happens
chown -R "$(logname):$(logname)" \
"$FEISTY_MEOW_LOADING_DOCK"/* "$FEISTY_MEOW_GENERATED_STORE"/* 2>/dev/null
regenerate >/dev/null
pushd "$FEISTY_MEOW_LOADING_DOCK/custom" &>/dev/null
incongruous_files="$(bash "$FEISTY_MEOW_SCRIPTS/files/list_non_dupes.sh" "$FEISTY_MEOW_SCRIPTS/customize/$custom_user" "$FEISTY_MEOW_LOADING_DOCK/custom")"
regenerate >/dev/null
pushd "$FEISTY_MEOW_LOADING_DOCK/custom" &>/dev/null
incongruous_files="$(bash "$FEISTY_MEOW_SCRIPTS/files/list_non_dupes.sh" "$FEISTY_MEOW_SCRIPTS/customize/$custom_user" "$FEISTY_MEOW_LOADING_DOCK/custom")"
- local fail_message="\nare the perl dependencies installed? if you're on ubuntu or debian, try this:\n
- $(grep "apt.*perl" $FEISTY_MEOW_APEX/readme.txt)\n"
-
+ local fail_message="\n
+are the perl dependencies installed? if you're on ubuntu or debian, try this:\n
+ $(grep "apt-get.*perl" $FEISTY_MEOW_APEX/readme.txt)\n
+or if you're on cygwin, then try this (if apt-cyg is available):\n
+ $(grep "apt-cyg.*perl" $FEISTY_MEOW_APEX/readme.txt)\n";
+
#echo "the incongruous files list is: $incongruous_files"
# disallow a single character result, since we get "*" as result when nothing exists yet.
if [ ${#incongruous_files} -ge 2 ]; then
echo "cleaning unknown older overrides..."
perl "$FEISTY_MEOW_SCRIPTS/files/safedel.pl" $incongruous_files
#echo "the incongruous files list is: $incongruous_files"
# disallow a single character result, since we get "*" as result when nothing exists yet.
if [ ${#incongruous_files} -ge 2 ]; then
echo "cleaning unknown older overrides..."
perl "$FEISTY_MEOW_SCRIPTS/files/safedel.pl" $incongruous_files
echo
fi
popd &>/dev/null
echo "copying custom overrides for $custom_user"
mkdir -p "$FEISTY_MEOW_LOADING_DOCK/custom" 2>/dev/null
perl "$FEISTY_MEOW_SCRIPTS/text/cpdiff.pl" "$FEISTY_MEOW_SCRIPTS/customize/$custom_user" "$FEISTY_MEOW_LOADING_DOCK/custom"
echo
fi
popd &>/dev/null
echo "copying custom overrides for $custom_user"
mkdir -p "$FEISTY_MEOW_LOADING_DOCK/custom" 2>/dev/null
perl "$FEISTY_MEOW_SCRIPTS/text/cpdiff.pl" "$FEISTY_MEOW_SCRIPTS/customize/$custom_user" "$FEISTY_MEOW_LOADING_DOCK/custom"
if [ -d "$FEISTY_MEOW_SCRIPTS/customize/$custom_user/scripts" ]; then
echo "copying custom scripts for $custom_user"
if [ -d "$FEISTY_MEOW_SCRIPTS/customize/$custom_user/scripts" ]; then
echo "copying custom scripts for $custom_user"
# prevent permission foul-ups, again.
chown -R "$(logname):$(logname)" \
"$FEISTY_MEOW_LOADING_DOCK" "$FEISTY_MEOW_GENERATED_STORE" 2>/dev/null
# prevent permission foul-ups, again.
chown -R "$(logname):$(logname)" \
"$FEISTY_MEOW_LOADING_DOCK" "$FEISTY_MEOW_GENERATED_STORE" 2>/dev/null
# count the number of sub-directories in a directory and echo the result.
function count_directories()
{
# count the number of sub-directories in a directory and echo the result.
function count_directories()
{
# make a backup first, oy.
\cp -f "$filename" "/tmp/$(basename ${filename}).bkup-${RANDOM}"
# make a backup first, oy.
\cp -f "$filename" "/tmp/$(basename ${filename}).bkup-${RANDOM}"
# make a temp file to write to before we move file into place in bind.
local new_version="/tmp/$(basename ${filename}).bkup-${RANDOM}"
\rm -f "$new_version"
# make a temp file to write to before we move file into place in bind.
local new_version="/tmp/$(basename ${filename}).bkup-${RANDOM}"
\rm -f "$new_version"
if [ ! -z "$found_any" ]; then
# put the file back into place under the original name.
\mv "$new_version" "$filename"
if [ ! -z "$found_any" ]; then
# put the file back into place under the original name.
\mv "$new_version" "$filename"
else
# cannot always be considered an error, but we can at least gripe.
echo "Did not find any matches for seeker '$seeker' in file: $filename"
else
# cannot always be considered an error, but we can at least gripe.
echo "Did not find any matches for seeker '$seeker' in file: $filename"