1

misc: use /usr/bin/env in scripts

This patch continues the work to support NixOS and others non-FHS
distributions by replacing instances of `/bin/bash` with
`/usr/bin/env bash`, which works correctly in more systems than the
former.

Signed-off-by: Luis Holanda <luiscmholanda@gmail.com>
This commit is contained in:
Luis Holanda 2022-07-27 17:33:53 -03:00 committed by Motiejus Jakštys
parent c4125cf13b
commit 8b5c41e409
7 changed files with 8 additions and 8 deletions

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -xeuo pipefail set -xeuo pipefail

View File

@ -1,9 +1,9 @@
#!/bin/bash #!/usr/bin/env bash
set -euo pipefail set -euo pipefail
REPO_ROOT=$(git rev-parse --show-toplevel) REPO_ROOT=$(git rev-parse --show-toplevel)
cd "$REPO_ROOT" cd "$REPO_ROOT"
# shellcheck disable=SC2046 # shellcheck disable=SC2046
shellcheck -x $(awk '/#!\/bin\/(ba)?sh/&&FNR==1{print FILENAME}' $(git ls-files)) shellcheck -x $(awk '/#!\/usr\/bin\/env/&&FNR==1{print FILENAME}' $(git ls-files))
find . \( -name 'WORKSPACE' -o -name 'BUILD' -o -name '*.bzl' \) -exec buildifier {} + find . \( -name 'WORKSPACE' -o -name 'BUILD' -o -name '*.bzl' \) -exec buildifier {} +

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -euo pipefail set -euo pipefail
indent() { sed 's/^/ /'; } indent() { sed 's/^/ /'; }

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -xeuo pipefail set -xeuo pipefail
cd "$(git rev-parse --show-toplevel)" cd "$(git rev-parse --show-toplevel)"

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -xeuo pipefail set -xeuo pipefail
bazel test ... bazel test ...

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -euo pipefail set -euo pipefail
zigdir=out/zig-x86_64-linux-musl-x86_64_v3 zigdir=out/zig-x86_64-linux-musl-x86_64_v3

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -xeuo pipefail set -xeuo pipefail
sign=(-u motiejus@jakstys.lt) sign=(-u motiejus@jakstys.lt)