Pull request: install check
Merge in DNS/adguard-home from 2453-install-check to master Closes #2453. Squashed commit of the following: commit b3123d7171ff5d1e00d8bcbb5cbe7fcf7a142a3c Author: Eugene Burkov <e.burkov@adguard.com> Date: Fri Dec 18 14:00:26 2020 +0300 all: fix quotes commit 27e17f9543250d912dd559c9ba2e01e35636551f Author: Eugene Burkov <e.burkov@adguard.com> Date: Fri Dec 18 13:34:00 2020 +0300 all: improve install script commit e9a927ffabc04dcd223bfc0b3b2541c7d5b96b61 Author: Eugene Burkov <e.burkov@adguard.com> Date: Fri Dec 18 13:22:05 2020 +0300 all: add directory emptiness check
This commit is contained in:
23
HACKING.md
23
HACKING.md
@@ -163,12 +163,15 @@ The rules are mostly sorted in the alphabetical order.
|
||||
|
||||
## Shell Scripting
|
||||
|
||||
* Avoid bashisms, prefer *POSIX* features only.
|
||||
* Avoid bashisms and GNUisms, prefer *POSIX* features only.
|
||||
|
||||
* Prefer `'raw strings'` to `"double quoted strings"` whenever possible.
|
||||
|
||||
* Put spaces within `$( cmd )`, `$(( expr ))`, and `{ cmd; }`.
|
||||
|
||||
* Put utility flags in the ASCII order and **don't** group them together. For
|
||||
example, `ls -1 -A -q`.
|
||||
|
||||
* `snake_case`, not `camelCase`.
|
||||
|
||||
* Use `set -e -f -u` and also `set -x` in verbose mode.
|
||||
@@ -176,6 +179,24 @@ The rules are mostly sorted in the alphabetical order.
|
||||
* Use the `"$var"` form instead of the `$var` form, unless word splitting is
|
||||
required.
|
||||
|
||||
* When concatenating, always use the form with curly braces to prevent
|
||||
accidental bad variable names. That is, `"${var}_tmp.txt"` and **not**
|
||||
`"$var_tmp.txt"`. The latter will try to lookup variable `var_tmp`.
|
||||
|
||||
* When concatenating, surround the whole string with quotes. That is, use
|
||||
this:
|
||||
|
||||
```sh
|
||||
dir="${TOP_DIR}/sub"
|
||||
```
|
||||
|
||||
And **not** this:
|
||||
|
||||
```sh
|
||||
# Bad!
|
||||
dir="${TOP_DIR}"/sub
|
||||
```
|
||||
|
||||
## Text, Including Comments
|
||||
|
||||
* End sentences with appropriate punctuation.
|
||||
|
||||
Reference in New Issue
Block a user