Skip to content

Commit

Permalink
Address shellcheck checks
Browse files Browse the repository at this point in the history
  • Loading branch information
jwodder committed May 30, 2023
1 parent 88ba7b5 commit d667a1d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/base-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
run: |
find . -name .git -prune -o -type f \
'!' '(' -name '*.txt' -o -name '*.md' ')' \
-exec grep -q -m1 '^#!/bin/.*sh' {} ';' \
-exec grep -q -m1 '^#!/bin/\(ba\|da\|k\)\?sh' {} ';' \
-print0 \
| xargs -0 shellcheck
Expand Down
10 changes: 5 additions & 5 deletions scripts/freeze_versions
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,12 @@ for arg in "$@"; do
# we were specified precisely with extension etc
imgpath="$imgprefix"
else
imgpaths=( $(/bin/ls -1 "$imgprefix".*) )
mapfile -t imgpaths < <( /bin/ls -1 "$imgprefix".* )
case ${#imgpaths[@]} in
0) error "There is no ${imgprefix}.* files. Available images for the app are:"
/bin/ls -1 "$topd/images/${img%%-*}/${img}--"* | sed -e 's,^, ,g' 1>&2
exit 1;;
1) imgpath=$(realpath -ms --relative-to="${save_ds:-.}" ${imgpaths[0]});; # already would include topd
1) imgpath=$(realpath -ms --relative-to="${save_ds:-.}" "${imgpaths[0]}");; # already would include topd
*) error "There are multiple images available. Include extension into your version specification. Available images are:"
echo "${imgpaths[@]}" | sed -e 's, ,\n ,g' -e 's,^, ,g'
exit 1;;
Expand All @@ -149,13 +149,13 @@ for arg in "$@"; do
# if it was a copy into some other super-dataset, we should copy some other fields
if [ -n "$topd_rel" ]; then
# if copying to some other dataset, procedure is different, since we need to copy all
git config -f $topd/.datalad/config --get-regexp "containers.${img}\." \
| while read var value; do
git config -f "$topd"/.datalad/config --get-regexp "containers.${img}\." \
| while read -r var value; do
case "${var##*.}" in
image) continue;; # already done above, skip
cmdexec)
if echo "$value" | grep -q '^{img_dspath}/'; then
value=$(echo "$value" | sed -e "s,{img_dspath}/,{img_dspath}/$topd_rel,g")
value="${value//{img_dspath}\//{img_dspath}\/$topd_rel}"
else
value="$topd_rel$value"
fi;;
Expand Down

0 comments on commit d667a1d

Please sign in to comment.