mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 04:22:55 +01:00
be4345ce12
000000035b20402dea3e8168165cd4eefdc97539 Obsolete #!/bin/bash shebang (DesWurstes) Pull request description: > `#!/bin/bash` assumes it is always installed to `/bin/` which can cause issues > `#!/usr/bin/env bash` searches the user's `PATH` to find the `bash` binary Details: https://github.com/dylanaraps/pure-bash-bible#obsolete-syntax I'm open to comments: Should I also fix `#!/bin/sh`? Tree-SHA512: b47bb4828116aa119f1899c68fee081270d51a898535490b9c616bf0f3660ad953f29c361eafc759bc64cdd54ee6eeecb2d79e9fdb5291a996a515c719805476
25 lines
976 B
Bash
Executable File
25 lines
976 B
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# Copyright (c) 2018 The Bitcoin Core developers
|
|
# Distributed under the MIT software license, see the accompanying
|
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
#
|
|
# Make sure all shell scripts:
|
|
# a.) explicitly opt out of locale dependence using "export LC_ALL=C", or
|
|
# b.) explicitly opt in to locale dependence using the annotation below.
|
|
|
|
export LC_ALL=C
|
|
|
|
EXIT_CODE=0
|
|
for SHELL_SCRIPT in $(git ls-files -- "*.sh" | grep -vE "src/(secp256k1|univalue)/"); do
|
|
if grep -q "# This script is intentionally locale dependent by not setting \"export LC_ALL=C\"" "${SHELL_SCRIPT}"; then
|
|
continue
|
|
fi
|
|
FIRST_NON_COMMENT_LINE=$(grep -vE '^(#.*)?$' "${SHELL_SCRIPT}" | head -1)
|
|
if [[ ${FIRST_NON_COMMENT_LINE} != "export LC_ALL=C" ]]; then
|
|
echo "Missing \"export LC_ALL=C\" (to avoid locale dependence) as first non-comment non-empty line in ${SHELL_SCRIPT}"
|
|
EXIT_CODE=1
|
|
fi
|
|
done
|
|
exit ${EXIT_CODE}
|