Skip to content

Commit

Permalink
refactor: Rename "*.{sh => bash}"
Browse files Browse the repository at this point in the history
Co-authored-by: Koichi Murase <myoga.murase@gmail.com>
  • Loading branch information
nntoan and akinomyoga committed Jan 15, 2022
1 parent 64f7b0b commit 4a608c7
Show file tree
Hide file tree
Showing 167 changed files with 64 additions and 64 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# custom files
!/custom/aliases/example.aliases.sh
!/custom/completions/example.completion.sh
!/custom/aliases/example.aliases.bash
!/custom/completions/example.completion.bash
!/custom/plugins/example/
!/custom/themes/example/
!/custom/example.sh
!/custom/example.bash
/custom/

# temp files directories
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ Oh My Bash is installed by running one of the following commands in your termina
#### via curl

```shell
bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh)"
bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.bash)"
```

#### via wget

```shell
bash -c "$(wget https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh -O -)"
bash -c "$(wget https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.bash -O -)"
```

## Using Oh My Bash
Expand Down Expand Up @@ -104,7 +104,7 @@ The default location is `~/.oh-my-bash` (hidden in your home directory)
If you'd like to change the install directory with the `OSH` environment variable, either by running `export OSH=/your/path` before installing, or by setting it before the end of the install pipeline like this:

```shell
export OSH="$HOME/.dotfiles/oh-my-bash"; sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh)"
export OSH="$HOME/.dotfiles/oh-my-bash"; sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.bash)"
```

#### Manual Installation
Expand Down Expand Up @@ -148,9 +148,9 @@ If you have any hiccups installing, here are a few common fixes.

### Custom Plugins and Themes

If you want to override any of the default behaviors, just add a new file (ending in `.sh`) in the `custom/` directory.
If you want to override any of the default behaviors, just add a new file (ending in `.bash`) in the `custom/` directory.

If you have many functions that go well together, you can put them as a `XYZ.plugin.sh` file in the `custom/plugins/` directory and then enable this plugin.
If you have many functions that go well together, you can put them as a `XYZ.plugin.bash` file in the `custom/plugins/` directory and then enable this plugin.

If you would like to override the functionality of a plugin distributed with Oh My Bash, create a plugin of the same name in the `custom/plugins/` directory and it will be loaded instead of the one in `plugins/`.

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions lib/functions.sh → lib/functions.bash
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ function bash_stats() {
}

function uninstall_oh_my_bash() {
env OSH=$OSH sh $OSH/tools/uninstall.sh
env OSH=$OSH sh $OSH/tools/uninstall.bash
}

function upgrade_oh_my_bash() {
env OSH=$OSH sh $OSH/tools/upgrade.sh
env OSH=$OSH sh $OSH/tools/upgrade.bash
}

function take() {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/nvm.sh → lib/nvm.bash
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
# get the node.js version
function nvm_prompt_info() {
[[ -f "$NVM_DIR/nvm.sh" ]] || return
[[ -f "$NVM_DIR/nvm.bash" ]] || return
local nvm_prompt
nvm_prompt=$(node -v 2>/dev/null)
[[ "${nvm_prompt}x" == "x" ]] && return
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions lib/utils.sh → lib/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
############################---Description---###################################
# #
# Summary : A collection of handy utilities and functions for bash #
# Support : destro.nnt@gmail.com #
# Support : hello@nntoan.com #
# Created date : Mar 18,2017 #
# Latest Modified date : Mar 18,2017 #
# Latest Modified date : Dec 24,2021 #
# #
################################################################################

############################---Usage---#########################################

# source ~/path/to/directory/utils.sh
# source ~/path/to/directory/utils.bash

########################## Styled text output ##################################

Expand Down
56 changes: 28 additions & 28 deletions oh-my-bash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ esac

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

# Initializes Oh My Bash
Expand All @@ -28,9 +28,9 @@ if [[ -z "$OSH_CACHE_DIR" ]]; then
OSH_CACHE_DIR="$OSH/cache"
fi

# Load all of the config files in ~/.oh-my-bash/lib that end in .sh
# Load all of the config files in ~/.oh-my-bash/lib that end in .bash
# TIP: Add files you don't want in git to .gitignore
for config_file in $OSH/lib/*.sh; do
for config_file in $OSH/lib/*.bash; do
custom_config_file="${OSH_CUSTOM}/lib/${config_file:t}"
[ -f "${custom_config_file}" ] && config_file=${custom_config_file}
source $config_file
Expand All @@ -40,7 +40,7 @@ done
is_plugin() {
local base_dir=$1
local name=$2
test -f $base_dir/plugins/$name/$name.plugin.sh \
test -f $base_dir/plugins/$name/$name.plugin.bash \
|| test -f $base_dir/plugins/$name/_$name
}
# Add all defined plugins to fpath. This must be done
Expand All @@ -56,7 +56,7 @@ done
is_completion() {
local base_dir=$1
local name=$2
test -f $base_dir/completions/$name/$name.completion.sh
test -f $base_dir/completions/$name/$name.completion.bash
}
# Add all defined completions to fpath. This must be done
# before running compinit.
Expand All @@ -71,7 +71,7 @@ done
is_alias() {
local base_dir=$1
local name=$2
test -f $base_dir/aliases/$name/$name.aliases.sh
test -f $base_dir/aliases/$name/$name.aliases.bash
}
# Add all defined completions to fpath. This must be done
# before running compinit.
Expand All @@ -93,59 +93,59 @@ fi

# Load all of the plugins that were defined in ~/.bashrc
for plugin in ${plugins[@]}; do
if [ -f $OSH_CUSTOM/plugins/$plugin/$plugin.plugin.sh ]; then
source $OSH_CUSTOM/plugins/$plugin/$plugin.plugin.sh
elif [ -f $OSH/plugins/$plugin/$plugin.plugin.sh ]; then
source $OSH/plugins/$plugin/$plugin.plugin.sh
if [ -f $OSH_CUSTOM/plugins/$plugin/$plugin.plugin.bash ]; then
source $OSH_CUSTOM/plugins/$plugin/$plugin.plugin.bash
elif [ -f $OSH/plugins/$plugin/$plugin.plugin.bash ]; then
source $OSH/plugins/$plugin/$plugin.plugin.bash
fi
done

# Load all of the aliases that were defined in ~/.bashrc
for alias in ${aliases[@]}; do
if [ -f $OSH_CUSTOM/aliases/$alias.aliases.sh ]; then
source $OSH_CUSTOM/aliases/$alias.aliases.sh
elif [ -f $OSH/aliases/$alias.aliases.sh ]; then
source $OSH/aliases/$alias.aliases.sh
if [ -f $OSH_CUSTOM/aliases/$alias.aliases.bash ]; then
source $OSH_CUSTOM/aliases/$alias.aliases.bash
elif [ -f $OSH/aliases/$alias.aliases.bash ]; then
source $OSH/aliases/$alias.aliases.bash
fi
done

# Load all of the completions that were defined in ~/.bashrc
for completion in ${completions[@]}; do
if [ -f $OSH_CUSTOM/completions/$completion.completion.sh ]; then
source $OSH_CUSTOM/completions/$completion.completion.sh
elif [ -f $OSH/completions/$completion.completion.sh ]; then
source $OSH/completions/$completion.completion.sh
if [ -f $OSH_CUSTOM/completions/$completion.completion.bash ]; then
source $OSH_CUSTOM/completions/$completion.completion.bash
elif [ -f $OSH/completions/$completion.completion.bash ]; then
source $OSH/completions/$completion.completion.bash
fi
done

# Load all of your custom configurations from custom/
for config_file in $OSH_CUSTOM/*.sh; do
for config_file in $OSH_CUSTOM/*.bash; do
if [ -f $config_file ]; then
source $config_file
fi
done
unset config_file

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

# Load the theme
if [ "$OSH_THEME" = "random" ]; then
themes=($OSH/themes/*/*theme.sh)
themes=($OSH/themes/*/*theme.bash)
N=${#themes[@]}
((N=(RANDOM%N)))
RANDOM_THEME=${themes[$N]}
source "$RANDOM_THEME"
echo "[oh-my-bash] Random theme '$RANDOM_THEME' loaded..."
else
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
source "$OSH_CUSTOM/themes/$OSH_THEME/$OSH_THEME.theme.sh"
if [ -f "$OSH_CUSTOM/$OSH_THEME/$OSH_THEME.theme.bash" ]; then
source "$OSH_CUSTOM/$OSH_THEME/$OSH_THEME.theme.bash"
elif [ -f "$OSH_CUSTOM/themes/$OSH_THEME/$OSH_THEME.theme.bash" ]; then
source "$OSH_CUSTOM/themes/$OSH_THEME/$OSH_THEME.theme.bash"
else
source "$OSH/themes/$OSH_THEME/$OSH_THEME.theme.sh"
source "$OSH/themes/$OSH_THEME/$OSH_THEME.theme.bash"
fi
fi
fi
Expand All @@ -155,7 +155,7 @@ if [[ $PROMPT ]]; then
fi

if ! type_exists '__git_ps1' ; then
source "$OSH/tools/git-prompt.sh"
source "$OSH/tools/git-prompt.bash"
fi

# Adding Support for other OSes
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion plugins/bu/bu.plugin.sh → plugins/bu/bu.plugin.bash
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# bu.plugin.sh
# bu.plugin.bash
# Author: Taleeb Midi <taleebmidi@gmail.com>
# Based on oh-my-zsh AWS plugin
#
Expand Down
2 changes: 1 addition & 1 deletion plugins/git/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Git Plugin

The git plugin defines a number of useful aliases for you. [Consult the complete list](git.plugin.sh#L34)
The git plugin defines a number of useful aliases for you. [Consult the complete list](git.plugin.bash#L34)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion themes/agnoster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ I recommend: https://github.com/powerline/fonts.git
```
git clone https://github.com/powerline/fonts.git fonts
cd fonts
install.sh
install.bash
```

The aim of this theme is to only show you *relevant* information. Like most
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# I recommend: https://github.com/powerline/fonts.git
# > git clone https://github.com/powerline/fonts.git fonts
# > cd fonts
# > install.sh
# > install.bash

# In addition, I recommend the
# [Solarized theme](https://github.com/altercation/solarized/) and, if you're
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ ___brainy_prompt_clock() {
}

___brainy_prompt_battery() {
[ ! -e $OSH/plugins/battery/battery.plugin.sh ] ||
[ ! -e $OSH/plugins/battery/battery.plugin.bash ] ||
[ "${THEME_SHOW_BATTERY}" != "true" ] && return
info=$(battery_percentage)
color=$bold_green
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ ${D_BRANCH_COLOR}%b %r ${D_CHANGES_COLOR}%m%u ${D_DEFAULT_COLOR}"

# checks if the plugin is installed before calling battery_charge
safe_battery_charge() {
if [ -e "${OSH}/plugins/battery/battery.plugin.sh" ];
if [ -e "${OSH}/plugins/battery/battery.plugin.bash" ];
then
battery_charge
fi
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

source "$OSH/themes/doubletime/doubletime.theme.sh"
source "$OSH/themes/doubletime/doubletime.theme.bash"

function prompt_setter() {
# Save history
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

source "$OSH/themes/doubletime/doubletime.theme.sh"
source "$OSH/themes/doubletime/doubletime.theme.bash"

function prompt_setter() {
# Save history
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion themes/powerline-multiline/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ A colorful multiline theme, where the first line shows information about your sh
* An indicator when connected by SSH
* An indicator when `sudo` has the credentials cached (see the `sudo` manpage for more info about this)
* An indicator when the current shell is inside the Vim editor
* Battery charging status (depends on the [../../plugins/battery/battery.plugin.sh](battery plugin))
* Battery charging status (depends on the [../../plugins/battery/battery.plugin.bash](battery plugin))
* SCM Repository status (e.g. Git, SVN)
* The current Python environment (Virtualenv, venv, and Conda are supported) in use
* The current Ruby environment (rvm and rbenv are supported) in use
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

source "$OSH/themes/powerline/powerline.base.sh"
source "$OSH/themes/powerline/powerline.base.bash"

function __powerline_last_status_prompt {
[[ "$1" -ne 0 ]] && echo "$(set_color ${LAST_STATUS_THEME_PROMPT_COLOR} -) ${1} ${normal}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

source "$OSH/themes/powerline-multiline/powerline-multiline.base.sh"
source "$OSH/themes/powerline-multiline/powerline-multiline.base.bash"

PROMPT_CHAR=${POWERLINE_PROMPT_CHAR:=""}
POWERLINE_LEFT_SEPARATOR=${POWERLINE_LEFT_SEPARATOR:=""}
Expand Down
2 changes: 1 addition & 1 deletion themes/powerline-naked/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ A colorful theme, where shows a lot information about your shell session.
* An indicator when connected by SSH
* An indicator when `sudo` has the credentials cached (see the `sudo` manpage for more info about this)
* An indicator when the current shell is inside the Vim editor
* Battery charging status (depends on the [../../plugins/battery/battery.plugin.sh](battery plugin))
* Battery charging status (depends on the [../../plugins/battery/battery.plugin.bash](battery plugin))
* SCM Repository status (e.g. Git, SVN)
* The current Python environment (Virtualenv, venv, and Conda are supported) in use
* The current Ruby environment (rvm and rbenv are supported) in use
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

source "$OSH/themes/powerline/powerline.base.sh"
source "$OSH/themes/powerline/powerline.base.bash"

function __powerline_left_segment {
local OLD_IFS="${IFS}"; IFS="|"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

source "$OSH/themes/powerline-naked/powerline-naked.base.sh"
source "$OSH/themes/powerline-naked/powerline-naked.base.bash"

PROMPT_CHAR=${POWERLINE_PROMPT_CHAR:=""}
POWERLINE_LEFT_SEPARATOR=${POWERLINE_LEFT_SEPARATOR:=""}
Expand Down
2 changes: 1 addition & 1 deletion themes/powerline-plain/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ A colorful theme, where shows a lot information about your shell session.
* An indicator when connected by SSH
* An indicator when `sudo` has the credentials cached (see the `sudo` manpage for more info about this)
* An indicator when the current shell is inside the Vim editor
* Battery charging status (depends on the [../../plugins/battery/battery.plugin.sh](battery plugin))
* Battery charging status (depends on the [../../plugins/battery/battery.plugin.bash](battery plugin))
* SCM Repository status (e.g. Git, SVN)
* The current Python environment (Virtualenv, venv, and Conda are supported) in use
* The current Ruby environment (rvm and rbenv are supported) in use
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

source "$OSH/themes/powerline/powerline.base.sh"
source "$OSH/themes/powerline/powerline.base.bash"

function __powerline_left_segment {
local OLD_IFS="${IFS}"; IFS="|"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

source "$OSH/themes/powerline-plain/powerline-plain.base.sh"
source "$OSH/themes/powerline-plain/powerline-plain.base.bash"

USER_INFO_SSH_CHAR=${POWERLINE_USER_INFO_SSH_CHAR:=""}
USER_INFO_THEME_PROMPT_COLOR=32
Expand Down
2 changes: 1 addition & 1 deletion themes/powerline/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ A colorful theme, where shows a lot information about your shell session.
* An indicator when connected by SSH
* An indicator when `sudo` has the credentials cached (see the `sudo` manpage for more info about this)
* An indicator when the current shell is inside the Vim editor
* Battery charging status (depends on the [../../plugins/battery/battery.plugin.sh](battery plugin))
* Battery charging status (depends on the [../../plugins/battery/battery.plugin.bash](battery plugin))
* SCM Repository status (e.g. Git, SVN)
* The current Python environment (Virtualenv, venv, and Conda are supported) in use
* The current Ruby environment (rvm and rbenv are supported) in use
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

source "$OSH/themes/powerline/powerline.base.sh"
source "$OSH/themes/powerline/powerline.base.bash"

PROMPT_CHAR=${POWERLINE_PROMPT_CHAR:=""}
POWERLINE_LEFT_SEPARATOR=${POWERLINE_LEFT_SEPARATOR:=""}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion themes/rana/rana.theme.sh → themes/rana/rana.theme.bash
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ ${D_BRANCH_COLOR}%b %r ${D_CHANGES_COLOR}%m%u ${D_DEFAULT_COLOR}"

# checks if the plugin is installed before calling battery_charge
safe_battery_charge() {
if [ -e "${OSH}/plugins/battery/battery.plugin.sh" ];
if [ -e "${OSH}/plugins/battery/battery.plugin.bash" ];
then
battery_charge
fi
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 4a608c7

Please sign in to comment.