Merge branch 'master' of ssh://feistymeow.org/feisty_meow
[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=true
7   # this variable causes the scripts that listen to it to print more information
8   # when they run.
9
10 ####fault--repeated code from bootstrap.  isolate to shared location.
11 # FEISTY_MEOW_GENERATED is where the generated files yeti uses are located.
12 export FEISTY_MEOW_GENERATED="$HOME/.zz_auto_gen"
13 if [ ! -z "$WINDIR" -o ! -z "$windir" ]; then
14   # assume they are using windoze.
15   export FEISTY_MEOW_GENERATED="$TMP/zz_auto_gen"
16 fi
17
18 # make sure our main variables are established.
19 GENERATED_FEISTY_MEOW_VARIABLES="$FEISTY_MEOW_GENERATED/feisty_meow_variables.sh"
20 if [ ! -f "$GENERATED_FEISTY_MEOW_VARIABLES" ]; then
21   echo -e '\n\n'
22   echo "The yeti scripts need to be initialized via the bootstrap process, e.g.:"
23   echo "  bash $HOME/feisty_meow/scripts/core/bootstrap_shells.sh"
24   echo -e '\n\n'
25 fi
26
27 # pull in our variable set.
28 source "$GENERATED_FEISTY_MEOW_VARIABLES"
29
30 # define a default name, if one wasn't already set.
31 if [ -z "$NAME" ]; then
32   export NAME='Unset Q. Namington, Fixley Your Name III'
33 fi
34
35 # check if this is dos/windows.
36 if [ "$OS" == "Windows_NT" ]; then
37   if [ -z "$HOME" ]; then
38     # set a default that might not be appropriate for everyone, but should
39     # still work.
40     export HOME=/c/home
41   fi
42   if [ ! -d "$HOME" ]; then mkdir $HOME; fi
43 ##  export FEISTY_MEOW_GENERATED=$TMP/zz_auto_gen
44 fi
45
46 if [ -z "$LIGHTWEIGHT_INIT" ]; then
47   # perform the bulk of the login.
48   source $FEISTY_MEOW_SCRIPTS/core/unix_login.sh
49 else
50   # this is the lightweight login that just wants variables set.
51   source $FEISTY_MEOW_SCRIPTS/core/lightweight_unix_login.sh
52 fi
53