Skip to content

Commit

Permalink
oh-my-bash: Changed extension on .bash
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Hrbek committed Jul 24, 2019
1 parent acfdadf commit fa54644
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions oh-my-bash.sh → oh-my-bash.bash
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
#!/usr/bin/env bash

# Error handling
## if {einfo,warn,die}() are not set globally (so that end-user can customize the error) then sets script's definitions
if ! command -v einfo > /dev/null; then einfo() { printf "INFO: %s\n" "$1" 1>&2 ; } fi
if ! command -v warn > /dev/null; then warn() { printf "WARN: %s\n" "$1" 1>&2 ; } fi
if ! command -v die > /dev/null; then die() {
case $1 in
# FALSE
1) printf "FATAL: %s\n" "$2" 1>&2 ; exit $1 ;;
# Custom
*) (printf "FATAL: Syntax error $([ -n "${FUNCNAME[0]}" ] && printf "in ${FUNCNAME[0]}")\n%s\n" "$2" 1>&2 ; exit "$1") || (printf "FATAL: %s\n" "$1" 1>&2 ; exit $1)
esac
} fi

# Bail out early if non-interactive
[[ $- != *i* ]] && die 1 "Shell is not interactive"
case $- in
*i*) ;;
*) return;;
esac

# Check for updates on initial load...
if ! ((DISABLE_AUTO_UPDATE)) ; then
if [ "$DISABLE_AUTO_UPDATE" != "true" ]; then
env OSH=$OSH DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT bash -f $OSH/tools/check_for_upgrade.sh
fi

Expand Down Expand Up @@ -94,7 +84,7 @@ for alias in ${aliases[@]}; do
done

# Figure out the SHORT hostname
if [[ $(uname) == Darwin* ]]; then
if [[ "$OSTYPE" = darwin* ]]; then
# macOS's $HOST changes with dhcp, etc. Use ComputerName if possible.
SHORT_HOST=$(scutil --get ComputerName 2>/dev/null) || SHORT_HOST=${HOST/.*/}
else
Expand Down Expand Up @@ -149,7 +139,7 @@ if [ "$OSH_THEME" = "random" ]; then
source "$RANDOM_THEME"
echo "[oh-my-bash] Random theme '$RANDOM_THEME' loaded..."
else
if [ -n "$OSH_THEME" ]; then
if [ ! "$OSH_THEME" = "" ]; then
if [ -f "$OSH_CUSTOM/$OSH_THEME/$OSH_THEME.theme.sh" ]; then
source "$OSH_CUSTOM/$OSH_THEME/$OSH_THEME.theme.sh"
elif [ -f "$OSH_CUSTOM/themes/$OSH_THEME/$OSH_THEME.theme.sh" ]; then
Expand Down

0 comments on commit fa54644

Please sign in to comment.