added NO_TEST_RUNS flag to skip running any tests.
[feisty_meow.git] / scripts / core / functions.sh
index 60f576295eff2f118d9a6efb2ea96d4eb73727f4..924266dc781f911ae5ec5c7f382e955ae22f5176 100644 (file)
@@ -291,9 +291,16 @@ if [ -z "$skip_all" ]; then
       return 1
     fi
     regenerate >/dev/null
+    pushd "$FEISTY_MEOW_GENERATED/custom" &>/dev/null
+    local incongruous_files="$(bash "$FEISTY_MEOW_SCRIPTS/files/list_non_dupes.sh" "$FEISTY_MEOW_DIR/customizing/$user" "$FEISTY_MEOW_GENERATED/custom")"
+    if [ ${#incongruous_files} -ge 1 ]; 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 $user"
-    perl "$FEISTY_MEOW_SCRIPTS/files/safedel.pl" "$FEISTY_MEOW_GENERATED/custom"
-    mkdir "$FEISTY_MEOW_GENERATED/custom"
+    mkdir "$FEISTY_MEOW_GENERATED/custom" 2>/dev/null
     perl "$FEISTY_MEOW_SCRIPTS/text/cpdiff.pl" "$FEISTY_MEOW_DIR/customizing/$user" "$FEISTY_MEOW_GENERATED/custom"
     regenerate
   }