first check-in of feisty meow codebase. many things broken still due to recent
[feisty_meow.git] / scripts / core / profile.sh
1 #!/bin/bash
2 # Hamster Login Profile.
3 #
4 # This file takes the place of .profile or other initialization scripts.
5
6 #export SHELL_DEBUG=
7 export SHELL_DEBUG=true
8   # this variable causes the scripts that listen to it to print more information
9   # when they run.
10
11 ####fault--repeated code from bootstrap.  isolate to shared location.
12 # GENERADIR is where the generated files yeti uses are located.
13 export GENERADIR="$HOME/.zz_auto_gen"
14 if [ ! -z "$WINDIR" -o ! -z "$windir" ]; then
15   # assume they are using windoze.
16   export GENERADIR="$TMP/zz_auto_gen"
17 fi
18
19 # make sure our main variables are established.
20 YETIVARS="$GENERADIR/yeti_variables.sh"
21 if [ ! -f "$YETIVARS" ]; then
22   echo -e '\n\n'
23   echo "The yeti scripts need to be initialized via the bootstrap process, e.g.:"
24   echo "  bash $HOME/feisty_meow/scripts/core/bootstrap_shells.sh"
25   echo -e '\n\n'
26 fi
27
28 # pull in our variable set.
29 source "$YETIVARS"
30
31 # define a default name, if one wasn't already set.
32 if [ -z "$NAME" ]; then
33   export NAME='Unset Q. Namington, Fixley Your Name III'
34 fi
35
36 # check if this is dos/windows.
37 if [ "$OS" == "Windows_NT" ]; then
38   if [ -z "$HOME" ]; then
39     # set a default that might not be appropriate for everyone, but should
40     # still work.
41     export HOME=/c/home
42   fi
43   if [ ! -d "$HOME" ]; then mkdir $HOME; fi
44 ##  export GENERADIR=$TMP/zz_auto_gen
45 fi
46
47 if [ -z "$LIGHTWEIGHT_INIT" ]; then
48   # perform the bulk of the login.
49   source $SHELLDIR/core/unix_login.sh
50 else
51   # this is the lightweight login that just wants variables set.
52   source $SHELLDIR/core/lightweight_unix_login.sh
53 fi
54