plugin/base: `shfmt`

Apply `shfmt` using current project settings. My apologies to future `git blame` hunters. ♥
pull/1930/head
John D Pell 2021-09-23 23:08:26 -07:00
parent 45bf7194a2
commit e66019daf1
2 changed files with 110 additions and 113 deletions

View File

@ -78,6 +78,7 @@ completion/available/wpscan.completion.bash
#
plugins/available/alias-completion.plugin.bash
plugins/available/autojump.plugin.bash
plugins/available/base.plugin.bash
plugins/available/basher.plugin.bash
plugins/available/cmd-returned-notify.plugin.bash
plugins/available/direnv.plugin.bash

View File

@ -5,11 +5,9 @@ about-plugin 'miscellaneous tools'
function ips() {
about 'display all ip addresses for this host'
group 'base'
if _command_exists ifconfig
then
if _command_exists ifconfig; then
ifconfig | awk '/inet /{ gsub(/addr:/, ""); print $2 }'
elif _command_exists ip
then
elif _command_exists ip; then
ip addr | grep -oP 'inet \K[\d.]+'
else
echo "You don't have ifconfig or ip command installed!"
@ -30,7 +28,7 @@ function myip() {
list=("http://myip.dnsomatic.com/" "http://checkip.dyndns.com/" "http://checkip.dyndns.org/")
for url in "${list[@]}"; do
if res="$(curl -fs "${url}")"; then
break;
break
fi
done
res="$(echo "$res" | grep -Eo '[0-9\.]+')"
@ -69,8 +67,7 @@ function passgen() {
# Create alias pass to passgen when pass isn't installed or
# BASH_IT_LEGACY_PASS is true.
if ! _command_exists pass || [[ "${BASH_IT_LEGACY_PASS:-}" = true ]]
then
if ! _command_exists pass || [[ "${BASH_IT_LEGACY_PASS:-}" = true ]]; then
alias pass=passgen
fi
@ -124,9 +121,8 @@ function usage() {
}
# shellcheck disable=SC2144 # the glob matches only one file
if [[ ! -e "${BASH_IT?}/plugins/enabled/todo.plugin.bash" \
&& ! -e "${BASH_IT?}/plugins/enabled"/*"${BASH_IT_LOAD_PRIORITY_SEPARATOR-}todo.plugin.bash" ]]
then
if [[ ! -e "${BASH_IT?}/plugins/enabled/todo.plugin.bash" &&
! -e "${BASH_IT?}/plugins/enabled"/*"${BASH_IT_LOAD_PRIORITY_SEPARATOR-}todo.plugin.bash" ]]; then
# if user has installed todo plugin, skip this...
function t() {
about 'one thing todo'
@ -179,6 +175,6 @@ function del() {
param 'file or folder to be deleted'
example 'del ./file.txt'
group 'base'
mkdir -p /tmp/.trash && mv "$@" /tmp/.trash;
mkdir -p /tmp/.trash && mv "$@" /tmp/.trash
}
fi