mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-01 11:11:15 +02: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:
@ -28,6 +28,8 @@ Developer Notes
|
||||
- [Strings and formatting](#strings-and-formatting)
|
||||
- [Variable names](#variable-names)
|
||||
- [Threads and synchronization](#threads-and-synchronization)
|
||||
- [Scripts](#scripts)
|
||||
- [Shebang](#shebang)
|
||||
- [Source code organization](#source-code-organization)
|
||||
- [GUI](#gui)
|
||||
- [Subtrees](#subtrees)
|
||||
@ -602,6 +604,31 @@ TRY_LOCK(cs_vNodes, lockNodes);
|
||||
}
|
||||
```
|
||||
|
||||
Scripts
|
||||
--------------------------
|
||||
|
||||
### Shebang
|
||||
|
||||
- Use `#!/usr/bin/env bash` instead of obsolete `#!/bin/bash`.
|
||||
|
||||
- [*Rationale*](https://github.com/dylanaraps/pure-bash-bible#shebang):
|
||||
|
||||
`#!/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.
|
||||
|
||||
OK:
|
||||
|
||||
```bash
|
||||
#!/usr/bin/env bash
|
||||
```
|
||||
|
||||
Wrong:
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
```
|
||||
|
||||
Source code organization
|
||||
--------------------------
|
||||
|
||||
|
Reference in New Issue
Block a user