Fix all Shellcheck SC2053 violations.

pull/143/head
Ben Peachey 3 years ago committed by Joseph Werle
parent f55825365e
commit 2e17e87472

@ -252,7 +252,7 @@ These are guidelines that we strongly encourage developers to follow.
It's nice to have a bash package that can be used in the terminal and also be invoked as a command line function. To achieve this the exporting of your functionality *should* follow this pattern:
```sh
if [[ ${BASH_SOURCE[0]} != $0 ]]; then
if [[ ${BASH_SOURCE[0]} != "$0" ]]; then
export -f my_script
else
my_script "${@}"

@ -1,7 +1,7 @@
#!/bin/bash
## prevent sourcing
if [[ ${BASH_SOURCE[0]} != $0 ]]; then
if [[ ${BASH_SOURCE[0]} != "$0" ]]; then
echo >&2 "error: \`bpkg' cannot be sourced"
return 1
fi

@ -43,7 +43,7 @@ bpkg_getdeps () {
return 0
}
if [[ ${BASH_SOURCE[0]} != $0 ]]; then
if [[ ${BASH_SOURCE[0]} != "$0" ]]; then
export -f bpkg_getdeps
else
bpkg_getdeps "${@}"

@ -231,7 +231,7 @@ create_shell_file () {
echo " ## your code here"
echo "}"
echo
echo 'if [[ ${BASH_SOURCE[0]} != $0 ]]; then'
echo 'if [[ ${BASH_SOURCE[0]} != "$0" ]]; then'
echo " export -f $NAME"
echo 'else'
echo " $NAME "'"${@}"'
@ -325,7 +325,7 @@ bpkg_init () {
}
## export or run
if [[ ${BASH_SOURCE[0]} != $0 ]]; then
if [[ ${BASH_SOURCE[0]} != "$0" ]]; then
export -f bpkg-init
else
bpkg_init "${@}"

@ -485,7 +485,7 @@ bpkg_install_from_remote () {
}
## Use as lib or perform install
if [[ ${BASH_SOURCE[0]} != $0 ]]; then
if [[ ${BASH_SOURCE[0]} != "$0" ]]; then
export -f bpkg_install
elif validate_parameters; then
bpkg_install "${@}"

@ -73,7 +73,7 @@ bpkg_list () {
}
if [[ ${BASH_SOURCE[0]} != $0 ]]; then
if [[ ${BASH_SOURCE[0]} != "$0" ]]; then
export -f bpkg_list
elif bpkg_validate; then
bpkg_list "${@}"

@ -49,7 +49,7 @@ bpkg_package () {
return 0
}
if [[ ${BASH_SOURCE[0]} != $0 ]]; then
if [[ ${BASH_SOURCE[0]} != "$0" ]]; then
export -f bpkg_package
else
bpkg_package "${@}"

@ -190,7 +190,7 @@ bpkg_show () {
return 1
}
if [[ ${BASH_SOURCE[0]} != $0 ]]; then
if [[ ${BASH_SOURCE[0]} != "$0" ]]; then
export -f bpkg_show
elif bpkg_validate; then
bpkg_show "${@}"

@ -93,7 +93,7 @@ suggest () {
}
## export or run
if [[ ${BASH_SOURCE[0]} != $0 ]]; then
if [[ ${BASH_SOURCE[0]} != "$0" ]]; then
export -f suggest
else
suggest "$@"

@ -286,7 +286,7 @@ term () {
## detect if being sourced and
## export if so else execute
## main function with args
if [[ ${BASH_SOURCE[0]} != $0 ]]; then
if [[ ${BASH_SOURCE[0]} != "$0" ]]; then
export -f term
else
term "${@}"

@ -75,7 +75,7 @@ bpkg_update () {
done
}
if [[ ${BASH_SOURCE[0]} != $0 ]]; then
if [[ ${BASH_SOURCE[0]} != "$0" ]]; then
export -f bpkg_update
elif bpkg_validate; then
bpkg_update "${@}"

Loading…
Cancel
Save