rudimentary java library beginning. cleaned up scripts quite
[feisty_meow.git] / scripts / core / bootstrap_shells.sh
1 #!/bin/bash
2 #
3 # bootstrap_shells:
4 #
5 # This script creates the directory for auto-generated scripts and gets
6 # the current user's account ready to use YETI.
7 #
8 # Note: this does not yet ensure that the YETI profile is executed on
9 # shell startup.  that can be added manually by editing your .bashrc file.
10 # read the examples/bashrc_user file for more details.
11
12 ORIGINATING_FOLDER="$( \cd "$(\dirname "$0")" && \pwd )"
13 YETI_CORE_SCRIPTS_DIR="$(echo "$ORIGINATING_FOLDER" | tr '\\\\' '/' )"
14 THIS_TOOL_NAME="$(basename "$0")"
15
16 ## check this scripts directory; do we find this script there?
17 #pushd "/" &>/dev/null  # jump to root so relative paths have to fail.
18 #if [ ! -f "$YETI_CORE_SCRIPTS_DIR/$THIS_TOOL_NAME" ]; then
19 #  echo "This script must be run using its full pathname.  This enables the script to"
20 #  echo "locate the proper folders.  Please try again with the full path, e.g.:"
21 #  echo "    bash /home/fred/codeplex/$THIS_TOOL_NAME"
22 #  exit 1
23 #fi
24 #popd &>/dev/null
25
26 # set up the feisty_meow dir.
27 pushd "$YETI_CORE_SCRIPTS_DIR/../.." &>/dev/null
28 export FEISTY_MEOW_DIR="$(pwd)"
29 popd &>/dev/null
30 #echo feisty_meow is $FEISTY_MEOW_DIR
31
32 export FEISTY_MEOW_SCRIPTS="$FEISTY_MEOW_DIR/scripts"
33
34 # FEISTY_MEOW_GENERATED is where the generated files feisty_meow uses are located.
35 export FEISTY_MEOW_GENERATED="$HOME/.zz_auto_gen"
36 if [ ! -z "$WINDIR" -o ! -z "$windir" ]; then
37   # assume they are using windoze.
38   export FEISTY_MEOW_GENERATED="$TMP/zz_auto_gen"
39 fi
40 if [ ! -d "$FEISTY_MEOW_GENERATED" ]; then
41   mkdir "$FEISTY_MEOW_GENERATED"
42 fi
43
44 # just a variable we use in here to refer to the generated variables file.
45 GENERATED_FEISTY_MEOW_VARIABLES="$FEISTY_MEOW_GENERATED/feisty_meow_variables.sh"
46 # create the alias file as totally blank.
47 echo -n >"$GENERATED_FEISTY_MEOW_VARIABLES"
48 for i in FEISTY_MEOW_DIR FEISTY_MEOW_SCRIPTS FEISTY_MEOW_GENERATED; do
49   echo "export $i=${!i}" >>"$GENERATED_FEISTY_MEOW_VARIABLES"
50 done
51
52 # create our common aliases.
53 perl "$FEISTY_MEOW_SCRIPTS/core/generate_aliases.pl"
54
55 echo ==========================================
56 echo Established this set of variables to describe how to find feisty_meow assets:
57 cat "$GENERATED_FEISTY_MEOW_VARIABLES"
58 echo ==========================================
59