Fix all Shellcheck SC2236 violations.

pull/143/head
Ben Peachey 3 years ago committed by Joseph Werle
parent 355a1bd49d
commit d30daebb1b

@ -90,7 +90,7 @@ bpkg () {
{
declare -a local res=($(commands))
if [ ! -z "${res}" ]; then
if [ -n "${res}" ]; then
echo
echo >&2 "Did you mean one of these?"
found=0

@ -22,7 +22,7 @@ prompt () {
value="${value//\"/\'}";
} 2>&1
if [ ! -z "${value}" ]; then
if [ -n "${value}" ]; then
eval "${var}=\"${value}\""
fi
}
@ -128,7 +128,7 @@ required () {
## convert scripts to quoted csv
csv () {
if [ ! -z "${SCRIPTS}" ]; then
if [ -n "${SCRIPTS}" ]; then
RAW_SCRIPTS=${SCRIPTS}
{
local TMP=""
@ -166,7 +166,7 @@ delimit () {
local lowercase="$(echo ${key} | tr '[:upper:]' '[:lower:]')"
eval local val="\${${key}}"
if [ ! -z "${val}" ]; then
if [ -n "${val}" ]; then
## swap leading/trailing quotes for brackets in arrays
local before="\""
@ -293,7 +293,7 @@ bpkg_init () {
;;
*)
if [ ! -z "${arg}" ]; then
if [ -n "${arg}" ]; then
error "Unknown option: \`${arg}'"
usage
exit 1

@ -404,7 +404,7 @@ bpkg_install_from_remote () {
{ (
## go to tmp dir
cd "$( [[ ! -z "${TMPDIR}" ]] && echo "${TMPDIR}" || echo /tmp)" &&
cd "$( [[ -n "${TMPDIR}" ]] && echo "${TMPDIR}" || echo /tmp)" &&
## prune existing
rm -rf "${name}-${version}" &&
## shallow clone

@ -269,7 +269,7 @@ term () {
"${cmd}" "${@}"
return $?
else
if [ ! -z "${arg}" ]; then
if [ -n "${arg}" ]; then
error "Unknown argument: \`${arg}'"
fi
usage

Loading…
Cancel
Save