Skip to content

Commit

Permalink
fix: shellcheck pre-commit checks
Browse files Browse the repository at this point in the history
  • Loading branch information
jjmaestro committed Nov 19, 2024
1 parent ba0208a commit 445ed20
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release_prep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ TAG=${GITHUB_REF_NAME}
# The prefix is chosen to match what GitHub generates for source archives
PREFIX="rules_foreign_cc-${TAG}"
ARCHIVE="rules_foreign_cc-$TAG.tar.gz"
git archive --format=tar --prefix=${PREFIX}/ ${TAG} | gzip > $ARCHIVE
SHA=$(shasum -a 256 $ARCHIVE | awk '{print $1}')
git archive --format=tar --prefix="${PREFIX}"/ "${TAG}" | gzip > "$ARCHIVE"
SHA="$(shasum -a 256 "$ARCHIVE" | awk '{print $1}')"

cat << EOF
## Using Bzlmod with Bazel 6
Expand All @@ -23,7 +23,7 @@ bazel_dep(name = "rules_foreign_cc", version = "${TAG}")
## Using WORKSPACE
Paste this snippet into your `WORKSPACE.bazel` file:
Paste this snippet into your \`WORKSPACE.bazel\` file:
\`\`\`starlark
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
Expand Down
2 changes: 1 addition & 1 deletion docs/tools/workspace_status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ set -euo pipefail

echo STABLE_SCM_SHORT_VERSION "$(git rev-parse --short HEAD)"
echo STABLE_SCM_VERSION "$(git rev-parse HEAD)"
echo STABLE_RELEASE "$(cat ../version.bzl | grep VERSION | sed 's/VERSION = "//' | sed 's/"//')"
echo STABLE_RELEASE "$(grep VERSION ../version.bzl | sed 's/VERSION = "//' | sed 's/"//')"
6 changes: 4 additions & 2 deletions foreign_cc/private/runnable_binary_wrapper.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

# shellcheck disable=SC1090

# --- begin runfiles.bash initialization v3 ---
# Copy-pasted from the Bazel Bash runfiles library v3.
set -uo pipefail; set +e; f=bazel_tools/tools/bash/runfiles/runfiles.bash
Expand Down Expand Up @@ -46,7 +48,7 @@ done < <(find . -name "*${SHARED_LIB_SUFFIX}" -print0)
SHARED_LIBS_DIRS_ARRAY=()
if [ ${#SHARED_LIBS_ARRAY[@]} -ne 0 ]; then
for lib in "${SHARED_LIBS_ARRAY[@]}"; do
SHARED_LIBS_DIRS_ARRAY+=($(dirname $(realpath $lib)))
SHARED_LIBS_DIRS_ARRAY+=("$(dirname "$(realpath "$lib")")")
done
fi

Expand All @@ -57,7 +59,7 @@ if [ ${#SHARED_LIBS_DIRS_ARRAY[@]} -ne 0 ]; then
# Allow unbound variable here, in case LD_LIBRARY_PATH or similar is not already set
set +u
for dir in "${SHARED_LIBS_DIRS_ARRAY[@]}"; do
export ${LIB_PATH_VAR}="$dir":"${!LIB_PATH_VAR}"
export "${LIB_PATH_VAR}"="${dir}:${!LIB_PATH_VAR}"
done
set -u
fi
Expand Down

0 comments on commit 445ed20

Please sign in to comment.