[#83] pre-commit: Add shellcheck hook

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2023-03-02 14:38:00 +03:00 committed by Gitea
parent 05471d3827
commit bce5827f64
3 changed files with 12 additions and 6 deletions

View file

@ -28,3 +28,9 @@ repos:
hooks:
- id: gitlint
stages: [commit-msg]
- repo: https://github.com/koalaman/shellcheck-precommit
rev: v0.9.0
hooks:
- id: shellcheck
# args: ["--severity=warning"] # Optionally only show errors and warnings

View file

@ -28,9 +28,9 @@ case "$1" in
chmod -f 0640 /etc/frostfs/$USERNAME/config.yml || true
chmod -f 0640 /etc/frostfs/$USERNAME/control.yml || true
fi
USERDIR=$(getent passwd "frostfs-$USERNAME" | cut -d: -f6)
if ! dpkg-statoverride --list frostfs-$USERDIR >/dev/null; then
chown -f frostfs-$USERNAME: $USERDIR
USERDIR="$(getent passwd frostfs-$USERNAME | cut -d: -f6)"
if ! dpkg-statoverride --list frostfs-"$USERDIR" >/dev/null; then
chown -f frostfs-$USERNAME: "$USERDIR"
fi
;;

View file

@ -28,9 +28,9 @@ case "$1" in
chmod -f 0640 /etc/frostfs/$USERNAME/config.yml || true
chmod -f 0640 /etc/frostfs/$USERNAME/control.yml || true
fi
USERDIR=$(getent passwd "frostfs-$USERNAME" | cut -d: -f6)
if ! dpkg-statoverride --list frostfs-$USERDIR >/dev/null; then
chown -f frostfs-$USERNAME: $USERDIR
USERDIR=$(getent passwd frostfs-$USERNAME | cut -d: -f6)
if ! dpkg-statoverride --list frostfs-"$USERDIR" >/dev/null; then
chown -f frostfs-$USERNAME: "$USERDIR"
fi
USERDIR=/srv/frostfs
if ! dpkg-statoverride --list frostfs-$USERDIR >/dev/null; then