blob: 226213fd5b33ed5679867f37d81eff077a3f093a [file] [log] [blame]
Eitan Adler3fc60b52012-04-17 00:24:58 -04001#!/usr/bin/env bash
Robert R Evans9c7cd9a2010-10-02 11:55:34 -07002# Initialize Bash It
3
4# Reload Library
5alias reload='source ~/.bash_profile'
6
John Schulze3194232011-10-28 19:22:20 -04007# Only set $BASH_IT if it's not already set
Travis Swicegoodb59ee652011-10-29 18:56:36 -05008if [ -z "$BASH_IT" ];
9then
10 # Setting $BASH to maintain backwards compatibility
11 # TODO: warn users that they should upgrade their .bash_profile
12 export BASH_IT=$BASH
13 export BASH=`bash -c 'echo $BASH'`
14fi
15
16# For backwards compatibility, look in old BASH_THEME location
17if [ -z "$BASH_IT_THEME" ];
18then
19 # TODO: warn users that they should upgrade their .bash_profile
20 export BASH_IT_THEME="$BASH_THEME";
21 unset $BASH_THEME;
22fi
Robert R Evans9c7cd9a2010-10-02 11:55:34 -070023
Erich Smitha8fcf9f2012-04-27 15:07:04 -040024# Load composure first, so we support function metadata
25source "${BASH_IT}/lib/composure.sh"
26
Nils Winklerbe209722012-05-23 09:24:42 +020027# support 'plumbing' metadata
28cite _about _param _example _group _author _version
29
Travis Swicegoodb6d444d2011-10-29 18:55:20 -050030# Load colors first so they can be use in base theme
31source "${BASH_IT}/themes/colors.theme.bash"
32source "${BASH_IT}/themes/base.theme.bash"
33
34# library
35LIB="${BASH_IT}/lib/*.bash"
36for config_file in $LIB
37do
38 source $config_file
39done
40
Travis Swicegoodd7cfa8b2011-06-21 09:31:26 -050041# Load enabled aliases, completion, plugins
42for file_type in "aliases" "completion" "plugins"
Robert R Evans9c7cd9a2010-10-02 11:55:34 -070043do
Travis Swicegoodb524bb62012-03-26 11:19:38 -050044 _load_bash_it_files $file_type
Robert R Evans9c7cd9a2010-10-02 11:55:34 -070045done
46
Travis Swicegoodd7cfa8b2011-06-21 09:31:26 -050047# Load any custom aliases that the user has added
John Schulz323ce202011-09-20 11:07:48 -040048if [ -e "${BASH_IT}/aliases/custom.aliases.bash" ]
Mark Szymanski78270b32011-06-17 11:22:39 -050049then
John Schulz323ce202011-09-20 11:07:48 -040050 source "${BASH_IT}/aliases/custom.aliases.bash"
Mark Szymanski78270b32011-06-17 11:22:39 -050051fi
Mark Szymanski50179fd2011-06-13 22:05:45 -050052
Robert R Evans9c7cd9a2010-10-02 11:55:34 -070053# Custom
John Schulz323ce202011-09-20 11:07:48 -040054CUSTOM="${BASH_IT}/custom/*.bash"
Robert R Evans9c7cd9a2010-10-02 11:55:34 -070055for config_file in $CUSTOM
56do
Jon Schewe7d18ccc2011-10-09 20:44:29 -050057 if [ -e "${config_file}" ]; then
58 source $config_file
59 fi
Robert R Evansa7d1ee02010-10-02 15:04:24 -070060done
61
Robert R Evans2010f012010-10-10 09:24:19 -070062unset config_file
John Schulz6e7f4232010-11-11 11:57:47 -050063if [[ $PROMPT ]]; then
64 export PS1=$PROMPT
65fi
Robert R Evansc9da0862010-10-06 17:27:55 -070066
67# Adding Support for other OSes
68PREVIEW="less"
69[ -s /usr/bin/gloobus-preview ] && PREVIEW="gloobus-preview"
70[ -s /Applications/Preview.app ] && PREVIEW="/Applications/Preview.app"
71
Mark Szymanski9ad79642011-06-24 17:49:19 -050072# Load all the Jekyll stuff
73
74if [ -e $HOME/.jekyllconfig ]
75then
76 . $HOME/.jekyllconfig
77fi