separated recustomize function out as separate script. added bin.ant and bin.eclipse...
[feisty_meow.git] / scripts / core / recustomize.sh
1 #!/bin/bash
2
3 # copies a set of custom scripts into the proper location for feisty meow
4 # to merge their functions and aliases with the standard set.
5
6
7 source "$FEISTY_MEOW_SCRIPTS/core/functions.sh"
8
9 #  function recustomize()
10 #{
11
12 user="$1"; shift
13 if [ -z "$user" ]; then
14   # use our default example user if there was no name provided.
15   user=fred
16 fi
17 if [ ! -d "$FEISTY_MEOW_APEX/customizing/$user" ]; then
18   echo "The customization folder provided for $user should be:"
19   echo "  '$FEISTY_MEOW_APEX/customizing/$user'"
20   echo "but that folder does not exist.  Skipping customization."
21   return 1
22 fi
23 regenerate >/dev/null
24 pushd "$FEISTY_MEOW_LOADING_DOCK/custom" &>/dev/null
25 incongruous_files="$(bash "$FEISTY_MEOW_SCRIPTS/files/list_non_dupes.sh" "$FEISTY_MEOW_APEX/customizing/$user" "$FEISTY_MEOW_LOADING_DOCK/custom")"
26
27 #echo "the incongruous files list is: $incongruous_files"
28 # disallow a single character result, since we get "*" as result when nothing exists yet.
29 if [ ${#incongruous_files} -ge 2 ]; then
30   echo "cleaning unknown older overrides..."
31   perl "$FEISTY_MEOW_SCRIPTS/files/safedel.pl" $incongruous_files
32   echo
33 fi
34 popd &>/dev/null
35 echo "copying custom overrides for $user"
36 mkdir -p "$FEISTY_MEOW_LOADING_DOCK/custom" 2>/dev/null
37 perl "$FEISTY_MEOW_SCRIPTS/text/cpdiff.pl" "$FEISTY_MEOW_APEX/customizing/$user" "$FEISTY_MEOW_LOADING_DOCK/custom"
38 if [ -d "$FEISTY_MEOW_APEX/customizing/$user/scripts" ]; then
39   echo "copying custom scripts for $user"
40   \cp -R "$FEISTY_MEOW_APEX/customizing/$user/scripts" "$FEISTY_MEOW_LOADING_DOCK/custom/"
41 fi
42 echo
43 regenerate
44 #}
45
46