From 8b5c41e409bc3d82577d1e4b9c51d5acd95ab474 Mon Sep 17 00:00:00 2001 From: Luis Holanda Date: Wed, 27 Jul 2022 17:33:53 -0300 Subject: [PATCH] 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 --- bin/mod-tidy | 2 +- ci/lint | 4 ++-- ci/list_toolchains_platforms | 2 +- ci/release | 2 +- ci/test | 2 +- contrib/makerel | 2 +- release | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bin/mod-tidy b/bin/mod-tidy index 0c66f25..b3d0971 100755 --- a/bin/mod-tidy +++ b/bin/mod-tidy @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -xeuo pipefail diff --git a/ci/lint b/ci/lint index 8c52243..f84eaa1 100755 --- a/ci/lint +++ b/ci/lint @@ -1,9 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail REPO_ROOT=$(git rev-parse --show-toplevel) cd "$REPO_ROOT" # 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 {} + diff --git a/ci/list_toolchains_platforms b/ci/list_toolchains_platforms index a7d0342..fae9ab8 100755 --- a/ci/list_toolchains_platforms +++ b/ci/list_toolchains_platforms @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail indent() { sed 's/^/ /'; } diff --git a/ci/release b/ci/release index 5149c64..b166828 100755 --- a/ci/release +++ b/ci/release @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -xeuo pipefail cd "$(git rev-parse --show-toplevel)" diff --git a/ci/test b/ci/test index 269510d..5aaac7a 100755 --- a/ci/test +++ b/ci/test @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -xeuo pipefail bazel test ... diff --git a/contrib/makerel b/contrib/makerel index 045b422..de614db 100755 --- a/contrib/makerel +++ b/contrib/makerel @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail zigdir=out/zig-x86_64-linux-musl-x86_64_v3 diff --git a/release b/release index c3a4976..d49de26 100755 --- a/release +++ b/release @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -xeuo pipefail sign=(-u motiejus@jakstys.lt)