Skip to content

Commit

Permalink
shellcheck proof
Browse files Browse the repository at this point in the history
  • Loading branch information
yarikoptic committed Nov 11, 2024
1 parent 1f71403 commit 49199cf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tools/inject-schema
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repo=${2:-} # optionally - use the local repo

[ -z "$repo" ] || repo=$(readlink -f "$repo")

cd $(dirname "$0")/..
cd "$(dirname "$0")/.."

if [ "$rel" = "master" ]; then
treeish="$rel"
Expand Down
6 changes: 4 additions & 2 deletions tools/inject-schema-fully-auto
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ this_path=$(dirname "$0")
versions_path="${this_path}/../versions"

TMP="$(mktemp -d "${TMPDIR:-/tmp}"/bids-XXXXXXX)"
# shellcheck disable=SC2064
trap "rm -rf '$TMP'" SIGINT SIGHUP SIGABRT EXIT

: ${BIDS_REPO:=}
: "${BIDS_REPO:=}"

if [ -z "$BIDS_REPO" ]; then
BIDS_REPO="$TMP/bids-specification"
Expand All @@ -38,9 +39,10 @@ fi
if [ -n "$to_inject" ]; then
# TODO: setup venv
venv="$TMP/venv"
# shellcheck disable=SC1091
python3 -m "venv" "$venv" && source "$venv/bin/activate"
python -m pip install -r requirements.txt
echo -e "$to_inject" | while read committish folder; do
echo -e "$to_inject" | while read -r committish folder; do
[ -n "$committish" ] || continue
git -C "$BIDS_REPO" checkout "$committish"
"$this_path/inject-schema" "$folder" "$BIDS_REPO"
Expand Down
4 changes: 2 additions & 2 deletions tools/version_component.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ repo="$1"
shift

cd "$repo"
if [ -z "$@" ]; then
if [ -z "$*" ]; then
# no components given -- just
comm=HEAD
else
comm=$(git log -1 --pretty=format:%H "$@*")
comm=$(git log -1 --pretty=format:%H "$@")
fi

cver=$(git describe --match=v[0-9].*.* "$comm")
Expand Down

0 comments on commit 49199cf

Please sign in to comment.