HomePhabricator

[LINTER] Enforce using `#!/usr/bin/env bash` for shell scripts

Description

[LINTER] Enforce using #!/usr/bin/env bash for shell scripts

Summary:
Update the shell scripts to always have a shebang and use whether bash:

#!/usr/bin/env bash

or the system shell:

#!/bin/sh

Other forms will throw an arcanist error at lint time.

Backport of core PR13320, PR13510 and PR14831
https://github.com/bitcoin/bitcoin/pull/13320/files
https://github.com/bitcoin/bitcoin/pull/13510/files
https://github.com/bitcoin/bitcoin/pull/14831/files

Depends on D3945.

Test Plan:
Edit a shell script to have a bas shebang then run:

arc lint

Ensure the linter catches the error.

Should return no error (requires D3946 to have zero output):

arc lint --everything

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D3947

Details

Provenance
FabienAuthored on Aug 26 2019, 09:40
FabienPushed on Aug 29 2019, 09:05
Reviewer
Restricted Project
Differential Revision
D3947: [LINTER] Enforce using `#!/usr/bin/env bash` for shell scripts
Parents
rABC2138f2cd458f: Improve formatting of developer notes
Branches
Unknown
Tags
Unknown