Skip to content
This repository
tree: 4df96400ab
Fetching contributors…

Cannot retrieve contributors at this time

executable file 94 lines (78 sloc) 2.565 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
#!/usr/bin/env bash
# Initialize Bash It

# Reload Library
alias reload='source ~/.bash_profile'

# Only set $BASH_IT if it's not already set
if [ -z "$BASH_IT" ];
then
    # Setting $BASH to maintain backwards compatibility
    # TODO: warn users that they should upgrade their .bash_profile
    export BASH_IT=$BASH
    export BASH=`bash -c 'echo $BASH'`
fi

# For backwards compatibility, look in old BASH_THEME location
if [ -z "$BASH_IT_THEME" ];
then
    # TODO: warn users that they should upgrade their .bash_profile
    export BASH_IT_THEME="$BASH_THEME";
    unset $BASH_THEME;
fi

# Load composure first, so we support function metadata
source "${BASH_IT}/lib/composure.sh"

# Load colors first so they can be use in base theme
source "${BASH_IT}/themes/colors.theme.bash"
source "${BASH_IT}/themes/base.theme.bash"

# library
LIB="${BASH_IT}/lib/*.bash"
for config_file in $LIB
do
  source $config_file
done

# Load enabled aliases, completion, plugins
for file_type in "aliases" "completion" "plugins"
do
  _load_bash_it_files $file_type
done

# Load any custom aliases that the user has added
if [ -e "${BASH_IT}/aliases/custom.aliases.bash" ]
then
  source "${BASH_IT}/aliases/custom.aliases.bash"
fi

# Custom
CUSTOM="${BASH_IT}/custom/*.bash"
for config_file in $CUSTOM
do
  if [ -e "${config_file}" ]; then
    source $config_file
  fi
done

unset config_file
if [[ $PROMPT ]]; then
    export PS1=$PROMPT
fi

# Adding Support for other OSes
PREVIEW="less"
[ -s /usr/bin/gloobus-preview ] && PREVIEW="gloobus-preview"
[ -s /Applications/Preview.app ] && PREVIEW="/Applications/Preview.app"

# Load all the Jekyll stuff

if [ -e $HOME/.jekyllconfig ]
then
  . $HOME/.jekyllconfig
fi


#
# Custom Help

function bash-it() {
  echo "Welcome to Bash It!"
  echo
echo "Here is a list of commands you can use to get help screens for specific pieces of Bash it:"
  echo
echo " rails-help list out all aliases you can use with rails."
  echo " git-help list out all aliases you can use with git."
  echo " todo-help list out all aliases you can use with todo.txt-cli"
  echo " brew-help list out all aliases you can use with Homebrew"
  echo " aliases-help generic list of aliases."
  echo " plugins-help list out all functions you have installed with bash-it"
  echo " bash-it-plugins summarize bash-it plugins, and their installation status"
  echo " reference <function name> detailed help for a specific function"
  echo
}
Something went wrong with that request. Please try again.