Robert R Evans | 76ed68d | 2010-10-02 12:29:17 -0700 | [diff] [blame] | 1 | #!/bin/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 | |
Robert R Evans | 79e5029 | 2010-10-12 14:14:20 -0700 | [diff] [blame] | 7 | # Load the framework |
Robert R Evans | 9c7cd9a | 2010-10-02 11:55:34 -0700 | [diff] [blame] | 8 | |
John Schulz | d5645e7 | 2010-11-09 23:21:19 -0500 | [diff] [blame] | 9 | # Load colors first so they can be use in base theme |
| 10 | source "${BASH}/themes/colors.theme.bash" |
| 11 | source "${BASH}/themes/base.theme.bash" |
Robert R Evans | 070107a | 2010-10-02 15:23:57 -0700 | [diff] [blame] | 12 | |
Robert R Evans | 9c7cd9a | 2010-10-02 11:55:34 -0700 | [diff] [blame] | 13 | # Library |
| 14 | LIB="${BASH}/lib/*.bash" |
| 15 | for config_file in $LIB |
| 16 | do |
| 17 | source $config_file |
| 18 | done |
| 19 | |
Travis Swicegood | d7cfa8b | 2011-06-21 09:31:26 -0500 | [diff] [blame] | 20 | # Load enabled aliases, completion, plugins |
| 21 | for file_type in "aliases" "completion" "plugins" |
Robert R Evans | 9c7cd9a | 2010-10-02 11:55:34 -0700 | [diff] [blame] | 22 | do |
Travis Swicegood | d7cfa8b | 2011-06-21 09:31:26 -0500 | [diff] [blame] | 23 | if [ ! -d "${BASH}/${file_type}/enabled" ] |
| 24 | then |
Noorul Islam K M | 8e0b668 | 2011-08-22 12:35:00 +0530 | [diff] [blame^] | 25 | continue |
Travis Swicegood | d7cfa8b | 2011-06-21 09:31:26 -0500 | [diff] [blame] | 26 | fi |
| 27 | FILES="${BASH}/${file_type}/enabled/*.bash" |
| 28 | for config_file in $FILES |
| 29 | do |
| 30 | source $config_file |
| 31 | done |
Robert R Evans | 9c7cd9a | 2010-10-02 11:55:34 -0700 | [diff] [blame] | 32 | done |
| 33 | |
Travis Swicegood | d7cfa8b | 2011-06-21 09:31:26 -0500 | [diff] [blame] | 34 | # Load any custom aliases that the user has added |
Mark Szymanski | 78270b3 | 2011-06-17 11:22:39 -0500 | [diff] [blame] | 35 | if [ -e "${BASH}/aliases/custom.aliases.bash" ] |
| 36 | then |
| 37 | source "${BASH}/aliases/custom.aliases.bash" |
| 38 | fi |
Mark Szymanski | 50179fd | 2011-06-13 22:05:45 -0500 | [diff] [blame] | 39 | |
Robert R Evans | 9c7cd9a | 2010-10-02 11:55:34 -0700 | [diff] [blame] | 40 | # Custom |
| 41 | CUSTOM="${BASH}/custom/*.bash" |
| 42 | for config_file in $CUSTOM |
| 43 | do |
| 44 | source $config_file |
Robert R Evans | a7d1ee0 | 2010-10-02 15:04:24 -0700 | [diff] [blame] | 45 | done |
| 46 | |
Robert R Evans | 2010f01 | 2010-10-10 09:24:19 -0700 | [diff] [blame] | 47 | |
| 48 | unset config_file |
John Schulz | 6e7f423 | 2010-11-11 11:57:47 -0500 | [diff] [blame] | 49 | if [[ $PROMPT ]]; then |
| 50 | export PS1=$PROMPT |
| 51 | fi |
Robert R Evans | c9da086 | 2010-10-06 17:27:55 -0700 | [diff] [blame] | 52 | |
| 53 | # Adding Support for other OSes |
| 54 | PREVIEW="less" |
| 55 | [ -s /usr/bin/gloobus-preview ] && PREVIEW="gloobus-preview" |
| 56 | [ -s /Applications/Preview.app ] && PREVIEW="/Applications/Preview.app" |
| 57 | |
Mark Szymanski | 9ad7964 | 2011-06-24 17:49:19 -0500 | [diff] [blame] | 58 | # Load all the Jekyll stuff |
| 59 | |
| 60 | if [ -e $HOME/.jekyllconfig ] |
| 61 | then |
| 62 | . $HOME/.jekyllconfig |
| 63 | fi |
| 64 | |
Robert R Evans | c9da086 | 2010-10-06 17:27:55 -0700 | [diff] [blame] | 65 | |
Robert R Evans | a7d1ee0 | 2010-10-02 15:04:24 -0700 | [diff] [blame] | 66 | # |
| 67 | # Custom Help |
| 68 | |
| 69 | function bash-it() { |
| 70 | echo "Welcome to Bash It!" |
| 71 | echo |
| 72 | echo "Here is a list of commands you can use to get help screens for specific pieces of Bash it:" |
| 73 | echo |
| 74 | echo " rails-help This will list out all the aliases you can use with rails." |
| 75 | echo " git-help This will list out all the aliases you can use with git." |
Mark Szymanski | e6fb703 | 2010-10-31 15:32:22 -0500 | [diff] [blame] | 76 | echo " todo-help This will list out all the aliases you can use with todo.txt-cli" |
Mark Szymanski | b7a0cb6 | 2011-06-05 20:45:53 -0500 | [diff] [blame] | 77 | echo " brew-help This will list out all the aliases you can use with Homebrew" |
Robert R Evans | 5e0e86f | 2010-10-02 15:29:23 -0700 | [diff] [blame] | 78 | echo " aliases-help Generic list of aliases." |
Florian Baumann | bd22485 | 2010-11-08 21:52:49 +0100 | [diff] [blame] | 79 | echo " plugins-help This will list out all the plugins and functions you can use with bash-it" |
Robert R Evans | a7d1ee0 | 2010-10-02 15:04:24 -0700 | [diff] [blame] | 80 | echo |
Mark Szymanski | e6fb703 | 2010-10-31 15:32:22 -0500 | [diff] [blame] | 81 | } |