Eitan Adler | 3fc60b5 | 2012-04-17 00:24:58 -0400 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Robert R Evans | 9c7cd9a | 2010-10-02 11:55:34 -0700 | [diff] [blame] | 2 | # Initialize Bash It |
| 3 | |
| 4 | # Reload Library |
| 5 | alias reload='source ~/.bash_profile' |
| 6 | |
John Schulz | e319423 | 2011-10-28 19:22:20 -0400 | [diff] [blame] | 7 | # Only set $BASH_IT if it's not already set |
Travis Swicegood | b59ee65 | 2011-10-29 18:56:36 -0500 | [diff] [blame] | 8 | if [ -z "$BASH_IT" ]; |
| 9 | then |
| 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'` |
| 14 | fi |
| 15 | |
| 16 | # For backwards compatibility, look in old BASH_THEME location |
| 17 | if [ -z "$BASH_IT_THEME" ]; |
| 18 | then |
| 19 | # TODO: warn users that they should upgrade their .bash_profile |
| 20 | export BASH_IT_THEME="$BASH_THEME"; |
| 21 | unset $BASH_THEME; |
| 22 | fi |
Robert R Evans | 9c7cd9a | 2010-10-02 11:55:34 -0700 | [diff] [blame] | 23 | |
Erich Smith | a8fcf9f | 2012-04-27 15:07:04 -0400 | [diff] [blame] | 24 | # Load composure first, so we support function metadata |
| 25 | source "${BASH_IT}/lib/composure.sh" |
| 26 | |
Nils Winkler | be20972 | 2012-05-23 09:24:42 +0200 | [diff] [blame] | 27 | # support 'plumbing' metadata |
| 28 | cite _about _param _example _group _author _version |
| 29 | |
Travis Swicegood | b6d444d | 2011-10-29 18:55:20 -0500 | [diff] [blame] | 30 | # Load colors first so they can be use in base theme |
| 31 | source "${BASH_IT}/themes/colors.theme.bash" |
| 32 | source "${BASH_IT}/themes/base.theme.bash" |
| 33 | |
| 34 | # library |
| 35 | LIB="${BASH_IT}/lib/*.bash" |
| 36 | for config_file in $LIB |
| 37 | do |
| 38 | source $config_file |
| 39 | done |
| 40 | |
Travis Swicegood | d7cfa8b | 2011-06-21 09:31:26 -0500 | [diff] [blame] | 41 | # Load enabled aliases, completion, plugins |
| 42 | for file_type in "aliases" "completion" "plugins" |
Robert R Evans | 9c7cd9a | 2010-10-02 11:55:34 -0700 | [diff] [blame] | 43 | do |
Travis Swicegood | b524bb6 | 2012-03-26 11:19:38 -0500 | [diff] [blame] | 44 | _load_bash_it_files $file_type |
Robert R Evans | 9c7cd9a | 2010-10-02 11:55:34 -0700 | [diff] [blame] | 45 | done |
| 46 | |
Travis Swicegood | d7cfa8b | 2011-06-21 09:31:26 -0500 | [diff] [blame] | 47 | # Load any custom aliases that the user has added |
John Schulz | 323ce20 | 2011-09-20 11:07:48 -0400 | [diff] [blame] | 48 | if [ -e "${BASH_IT}/aliases/custom.aliases.bash" ] |
Mark Szymanski | 78270b3 | 2011-06-17 11:22:39 -0500 | [diff] [blame] | 49 | then |
John Schulz | 323ce20 | 2011-09-20 11:07:48 -0400 | [diff] [blame] | 50 | source "${BASH_IT}/aliases/custom.aliases.bash" |
Mark Szymanski | 78270b3 | 2011-06-17 11:22:39 -0500 | [diff] [blame] | 51 | fi |
Mark Szymanski | 50179fd | 2011-06-13 22:05:45 -0500 | [diff] [blame] | 52 | |
Robert R Evans | 9c7cd9a | 2010-10-02 11:55:34 -0700 | [diff] [blame] | 53 | # Custom |
John Schulz | 323ce20 | 2011-09-20 11:07:48 -0400 | [diff] [blame] | 54 | CUSTOM="${BASH_IT}/custom/*.bash" |
Robert R Evans | 9c7cd9a | 2010-10-02 11:55:34 -0700 | [diff] [blame] | 55 | for config_file in $CUSTOM |
| 56 | do |
Jon Schewe | 7d18ccc | 2011-10-09 20:44:29 -0500 | [diff] [blame] | 57 | if [ -e "${config_file}" ]; then |
| 58 | source $config_file |
| 59 | fi |
Robert R Evans | a7d1ee0 | 2010-10-02 15:04:24 -0700 | [diff] [blame] | 60 | done |
| 61 | |
Robert R Evans | 2010f01 | 2010-10-10 09:24:19 -0700 | [diff] [blame] | 62 | unset config_file |
John Schulz | 6e7f423 | 2010-11-11 11:57:47 -0500 | [diff] [blame] | 63 | if [[ $PROMPT ]]; then |
| 64 | export PS1=$PROMPT |
| 65 | fi |
Robert R Evans | c9da086 | 2010-10-06 17:27:55 -0700 | [diff] [blame] | 66 | |
| 67 | # Adding Support for other OSes |
| 68 | PREVIEW="less" |
| 69 | [ -s /usr/bin/gloobus-preview ] && PREVIEW="gloobus-preview" |
| 70 | [ -s /Applications/Preview.app ] && PREVIEW="/Applications/Preview.app" |
| 71 | |
Mark Szymanski | 9ad7964 | 2011-06-24 17:49:19 -0500 | [diff] [blame] | 72 | # Load all the Jekyll stuff |
| 73 | |
| 74 | if [ -e $HOME/.jekyllconfig ] |
| 75 | then |
| 76 | . $HOME/.jekyllconfig |
| 77 | fi |