mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-26 15:36:19 +01:00
Scripts and tools & Docs: Used #!/usr/bin/env bash instead of obsolete #!/bin/bash, added linting for .sh files shebang and updated the Developer Notes.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) 2018 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Shebang must use python3 (not python or python2)
|
||||
# Assert expected shebang lines
|
||||
|
||||
export LC_ALL=C
|
||||
EXIT_CODE=0
|
||||
@@ -10,4 +10,11 @@ for PYTHON_FILE in $(git ls-files -- "*.py"); do
|
||||
EXIT_CODE=1
|
||||
fi
|
||||
done
|
||||
for SHELL_FILE in $(git ls-files -- "*.sh"); do
|
||||
if [[ $(head -n 1 "${SHELL_FILE}") != "#!/usr/bin/env bash" &&
|
||||
$(head -n 1 "${SHELL_FILE}") != "#!/bin/sh" ]]; then
|
||||
echo "Missing expected shebang \"#!/usr/bin/env bash\" or \"#!/bin/sh\" in ${SHELL_FILE}"
|
||||
EXIT_CODE=1
|
||||
fi
|
||||
done
|
||||
exit ${EXIT_CODE}
|
||||
Reference in New Issue
Block a user