Fix various Shellcheck violations.

pull/143/head
Ben Peachey 3 years ago committed by Joseph Werle
parent 7494024a57
commit 574a928de8

@ -33,8 +33,10 @@ bpkg_getdeps () {
return 1
fi
# shellcheck disable=SC2002
dependencies=$(cat "${pkg}" | bpkg-json -b | grep '\[\"dependencies' | sed "s/\[\"dependencies\",//" | sed "s/\"\]$(printf '\t')\"/@/" | tr -d '"')
dependencies=($(echo ${dependencies[@]}))
# shellcheck disable=SC2206
dependencies=(${dependencies[@]})
## run bpkg install for each dependency
for (( i = 0; i < ${#dependencies[@]} ; ++i )); do

@ -224,6 +224,7 @@ bpkg_install_from_remote () {
local name=''
local version=''
local auth_param=''
# shellcheck disable=SC2034
local let has_pkg_json=0
local files pkg_parts remote_parts scripts

@ -65,14 +65,14 @@ tokenize () {
local ESCAPE
local CHAR
if echo "test string" | egrep -ao --color=never "test" &>/dev/null
if echo "test string" | grep -aoE --color=never "test" &>/dev/null
then
GREP='egrep -ao --color=never'
GREP='grep -aoE --color=never'
else
GREP='egrep -ao'
GREP='grep -aoE'
fi
if echo "test string" | egrep -o "test" &>/dev/null
if echo "test string" | grep -oE "test" &>/dev/null
then
ESCAPE='(\\[^u[:cntrl:]]|\\u[0-9a-fA-F]{4})'
CHAR='[^[:cntrl:]"\\]'
@ -87,7 +87,7 @@ tokenize () {
local KEYWORD='null|false|true'
local SPACE='[[:space:]]+'
$GREP "$STRING|$NUMBER|$KEYWORD|$SPACE|." | egrep -v "^$SPACE$"
$GREP "$STRING|$NUMBER|$KEYWORD|$SPACE|." | grep -vE "^$SPACE$"
}
parse_array () {

@ -6,7 +6,8 @@ if ! type -f bpkg-utils &>/dev/null; then
echo "error: bpkg-utils not found, aborting"
exit 1
else
# shellcheck disable=SC2230 shellcheck source=../utils/utils.sh
# shellcheck disable=SC2230
# shellcheck source=../utils/utils.sh
source "$(which bpkg-utils)"
fi

@ -37,12 +37,14 @@ bpkg_package () {
## output all propertyies if property
## is ommited
{
# shellcheck disable=SC2002
cat "${pkg}" | bpkg-json -b
}
else
## show value for a specific property
## in 'bpkg.json' or 'package.json'
{
# shellcheck disable=SC2002
cat "${pkg}" | bpkg-json -b | grep "${prop}" | awk '{ $1=""; printf $0 }'
echo
}

@ -6,7 +6,8 @@ if ! type -f bpkg-utils &>/dev/null; then
echo "error: bpkg-utils not found, aborting"
exit 1
else
# shellcheck disable=SC2230 shellcheck source=../utils/utils.sh
# shellcheck disable=SC2230
# shellcheck source=../utils/utils.sh
source "$(which bpkg-utils)"
fi

@ -41,7 +41,7 @@ suggest () {
IFS=':' read -a paths <<< "${PATH}"
for (( i = 0; i < ${#paths[@]}; ++i )); do
local path="${paths[$i]}"
local let skip=0
local skip=0
## omit non existent paths
if ! test -d "${path}"; then

@ -63,6 +63,7 @@ term_move () {
term_transition () {
local let x="${1}"
# shellcheck disable=SC2034
local let y="${2}"
if [ -z "${x}" ] || [ -z "${y}" ]; then
return 1

@ -6,7 +6,8 @@ if ! type -f bpkg-utils &>/dev/null; then
echo "error: bpkg-utils not found, aborting"
exit 1
else
# shellcheck disable=SC2230 shellcheck source=../utils/utils.sh
# shellcheck disable=SC2230
# shellcheck source=../utils/utils.sh
source "$(which bpkg-utils)"
fi

Loading…
Cancel
Save