plugin/base: `shfmt`
Apply `shfmt` using current project settings. My apologies to future `git blame` hunters. ♥pull/1930/head
parent
45bf7194a2
commit
e66019daf1
|
|
@ -78,6 +78,7 @@ completion/available/wpscan.completion.bash
|
||||||
#
|
#
|
||||||
plugins/available/alias-completion.plugin.bash
|
plugins/available/alias-completion.plugin.bash
|
||||||
plugins/available/autojump.plugin.bash
|
plugins/available/autojump.plugin.bash
|
||||||
|
plugins/available/base.plugin.bash
|
||||||
plugins/available/basher.plugin.bash
|
plugins/available/basher.plugin.bash
|
||||||
plugins/available/cmd-returned-notify.plugin.bash
|
plugins/available/cmd-returned-notify.plugin.bash
|
||||||
plugins/available/direnv.plugin.bash
|
plugins/available/direnv.plugin.bash
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,9 @@ about-plugin 'miscellaneous tools'
|
||||||
function ips() {
|
function ips() {
|
||||||
about 'display all ip addresses for this host'
|
about 'display all ip addresses for this host'
|
||||||
group 'base'
|
group 'base'
|
||||||
if _command_exists ifconfig
|
if _command_exists ifconfig; then
|
||||||
then
|
|
||||||
ifconfig | awk '/inet /{ gsub(/addr:/, ""); print $2 }'
|
ifconfig | awk '/inet /{ gsub(/addr:/, ""); print $2 }'
|
||||||
elif _command_exists ip
|
elif _command_exists ip; then
|
||||||
then
|
|
||||||
ip addr | grep -oP 'inet \K[\d.]+'
|
ip addr | grep -oP 'inet \K[\d.]+'
|
||||||
else
|
else
|
||||||
echo "You don't have ifconfig or ip command installed!"
|
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/")
|
list=("http://myip.dnsomatic.com/" "http://checkip.dyndns.com/" "http://checkip.dyndns.org/")
|
||||||
for url in "${list[@]}"; do
|
for url in "${list[@]}"; do
|
||||||
if res="$(curl -fs "${url}")"; then
|
if res="$(curl -fs "${url}")"; then
|
||||||
break;
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
res="$(echo "$res" | grep -Eo '[0-9\.]+')"
|
res="$(echo "$res" | grep -Eo '[0-9\.]+')"
|
||||||
|
|
@ -69,8 +67,7 @@ function passgen() {
|
||||||
|
|
||||||
# Create alias pass to passgen when pass isn't installed or
|
# Create alias pass to passgen when pass isn't installed or
|
||||||
# BASH_IT_LEGACY_PASS is true.
|
# BASH_IT_LEGACY_PASS is true.
|
||||||
if ! _command_exists pass || [[ "${BASH_IT_LEGACY_PASS:-}" = true ]]
|
if ! _command_exists pass || [[ "${BASH_IT_LEGACY_PASS:-}" = true ]]; then
|
||||||
then
|
|
||||||
alias pass=passgen
|
alias pass=passgen
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -124,9 +121,8 @@ function usage() {
|
||||||
}
|
}
|
||||||
|
|
||||||
# shellcheck disable=SC2144 # the glob matches only one file
|
# shellcheck disable=SC2144 # the glob matches only one file
|
||||||
if [[ ! -e "${BASH_IT?}/plugins/enabled/todo.plugin.bash" \
|
if [[ ! -e "${BASH_IT?}/plugins/enabled/todo.plugin.bash" &&
|
||||||
&& ! -e "${BASH_IT?}/plugins/enabled"/*"${BASH_IT_LOAD_PRIORITY_SEPARATOR-}todo.plugin.bash" ]]
|
! -e "${BASH_IT?}/plugins/enabled"/*"${BASH_IT_LOAD_PRIORITY_SEPARATOR-}todo.plugin.bash" ]]; then
|
||||||
then
|
|
||||||
# if user has installed todo plugin, skip this...
|
# if user has installed todo plugin, skip this...
|
||||||
function t() {
|
function t() {
|
||||||
about 'one thing todo'
|
about 'one thing todo'
|
||||||
|
|
@ -179,6 +175,6 @@ function del() {
|
||||||
param 'file or folder to be deleted'
|
param 'file or folder to be deleted'
|
||||||
example 'del ./file.txt'
|
example 'del ./file.txt'
|
||||||
group 'base'
|
group 'base'
|
||||||
mkdir -p /tmp/.trash && mv "$@" /tmp/.trash;
|
mkdir -p /tmp/.trash && mv "$@" /tmp/.trash
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue