5 # This script creates the directory for auto-generated scripts and gets
6 # the current user's account ready to use the feisty meow scripts.
8 # Note: this does not yet ensure that the profile is executed on shell
9 # startup. that can be added manually by editing your .bashrc file.
10 # read the examples/feisty_meow_startup/bashrc_user file for more details.
12 ORIGINATING_FOLDER="$( \cd "$(\dirname "$0")" && \pwd )"
13 CORE_SCRIPTS_DIR="$(echo "$ORIGINATING_FOLDER" | tr '\\\\' '/' )"
14 THIS_TOOL_NAME="$(basename "$0")"
16 # set up the feisty_meow dir.
17 pushd "$CORE_SCRIPTS_DIR/../.." &>/dev/null
18 source "$CORE_SCRIPTS_DIR/functions.sh"
20 export FEISTY_MEOW_DIR="$(\pwd)"
22 # repetitive bit stolen from variables. should make a file out of this somehow.
23 IS_DOS=$(uname | grep -i ming)
24 if [ -z "$IS_DOS" ]; then IS_DOS=$(uname | grep -i cygwin); fi
25 # now if we're stuck in DOS, then fix the feisty meow variable name.
26 if [ ! -z "$IS_DOS" ]; then
27 FEISTY_MEOW_DIR="$(cmd /c chdir | tr A-Z a-z | sed -e 's/\\/\//g')"
28 echo feisty meow dos is: $FEISTY_MEOW_DIR
29 FEISTY_MEOW_DIR="$(dos_to_unix_path "$FEISTY_MEOW_DIR")"
30 echo new feisty meow fixed dir is: $FEISTY_MEOW_DIR
35 export FEISTY_MEOW_SCRIPTS="$FEISTY_MEOW_DIR/scripts"
37 # FEISTY_MEOW_GENERATED is where the generated files feisty_meow uses are located.
38 export FEISTY_MEOW_GENERATED="$HOME/.zz_auto_gen"
39 if [ ! -d "$FEISTY_MEOW_GENERATED" ]; then
40 mkdir "$FEISTY_MEOW_GENERATED"
42 # make toast out of generated files right away, but leave any custom scripts.
43 find "$FEISTY_MEOW_GENERATED" -maxdepth 1 -type f -exec rm -f "{}" ';' &>/dev/null
44 if [ ! -d "$FEISTY_MEOW_GENERATED/custom" ]; then
45 mkdir "$FEISTY_MEOW_GENERATED/custom"
48 # just a variable we use in here to refer to the generated variables file.
49 GENERATED_FEISTY_MEOW_VARIABLES="$FEISTY_MEOW_GENERATED/fmc_variables.sh"
50 # create the alias file as totally blank.
51 echo -n >"$GENERATED_FEISTY_MEOW_VARIABLES"
52 for i in FEISTY_MEOW_DIR FEISTY_MEOW_SCRIPTS FEISTY_MEOW_GENERATED; do
53 echo "export $i=${!i}" >>"$GENERATED_FEISTY_MEOW_VARIABLES"
56 # load our variables so we can run our perl scripts successfully.
57 source "$FEISTY_MEOW_SCRIPTS/core/variables.sh"
59 # create our common aliases.
60 perl "$FEISTY_MEOW_SCRIPTS/core/generate_aliases.pl"
62 if [ ! -z "$SHELL_DEBUG" ]; then
63 echo established these variables for feisty_meow assets:
65 cat "$GENERATED_FEISTY_MEOW_VARIABLES"