mirror of
https://github.com/bitwarden/server.git
synced 2026-02-10 19:03:18 +08:00
20 lines
558 B
Bash
Executable File
20 lines
558 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# Skip hook if this is a merge commit
|
|
if [ -f .git/MERGE_HEAD ]; then
|
|
exit 0
|
|
fi
|
|
|
|
FILES=$(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g')
|
|
[ -z "$FILES" ] && exit 0
|
|
|
|
if npx mega-linter-runner --containername "megalinter-incremental" \
|
|
--flavor formatters --remove-container --fix --env "'APPLY_FIXES=all'" \
|
|
--env "'CLEAR_REPORT_FOLDER=true'" --env "'LOG_LEVEL=warning'" \
|
|
--env "'FLAVOR_SUGGESTIONS=false'" --filesonly $FILES; then
|
|
echo "$FILES" | xargs git add
|
|
exit 0
|
|
fi
|
|
|
|
exit 1
|