using the variables script in our bootstrap, since otherwise PERLLIB isn't set yet.
[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/feisty_meow_startup/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 # set up the feisty_meow dir.
17 pushd "$YETI_CORE_SCRIPTS_DIR/../.." &>/dev/null
18 export FEISTY_MEOW_DIR="$(pwd)"
19 popd &>/dev/null
20
21 export FEISTY_MEOW_SCRIPTS="$FEISTY_MEOW_DIR/scripts"
22
23 # FEISTY_MEOW_GENERATED is where the generated files feisty_meow uses are located.
24 export FEISTY_MEOW_GENERATED="$HOME/.zz_auto_gen"
25 if [ ! -d "$FEISTY_MEOW_GENERATED" ]; then
26   mkdir "$FEISTY_MEOW_GENERATED"
27 fi
28 if [ ! -d "$FEISTY_MEOW_GENERATED/custom" ]; then
29   mkdir "$FEISTY_MEOW_GENERATED/custom"
30 fi
31
32 # just a variable we use in here to refer to the generated variables file.
33 GENERATED_FEISTY_MEOW_VARIABLES="$FEISTY_MEOW_GENERATED/fmc_variables.sh"
34 # create the alias file as totally blank.
35 echo -n >"$GENERATED_FEISTY_MEOW_VARIABLES"
36 for i in FEISTY_MEOW_DIR FEISTY_MEOW_SCRIPTS FEISTY_MEOW_GENERATED; do
37   echo "export $i=${!i}" >>"$GENERATED_FEISTY_MEOW_VARIABLES"
38 done
39
40 # load our variables so we get a useful PERLLIB variable.
41 source "$FEISTY_MEOW_SCRIPTS/core/variables.sh"
42
43 # create our common aliases.
44 perl "$FEISTY_MEOW_SCRIPTS/core/generate_aliases.pl"
45
46 echo ==========================================
47 echo Established this set of variables to describe how to find feisty_meow assets:
48 cat "$GENERATED_FEISTY_MEOW_VARIABLES"
49 echo ==========================================
50