Convert simple-icons manual backup from submodule to tracked files
This commit is contained in:
21
logos/simple-icons.manual-backup-20251123-234134/.husky/pre-commit
Executable file
21
logos/simple-icons.manual-backup-20251123-234134/.husky/pre-commit
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env sh
|
||||
# ^^^^^^^^^^^^^^^ Husky doesn't require this shebang,
|
||||
# but code editors need it to recognize the file as a script.
|
||||
|
||||
# Format and add the changes to the staging area
|
||||
npm run format
|
||||
git add --update
|
||||
|
||||
# POSIX shell (sh) run time parameters.
|
||||
# -e: Exit immediately if a command exits with a non-zero status.
|
||||
# -u: Treat unset variables as errors when substituting.
|
||||
set -eu
|
||||
|
||||
# Track exit code in case that we want to add other lints in the future
|
||||
EXITCODE=0
|
||||
|
||||
# If there are changed icons, lint them with SVGLint
|
||||
changed_icons=$(git diff --cached --name-only --diff-filter=ACM 'icons/' | xargs)
|
||||
[ -n "$changed_icons" ] && { npm run svglint:base -- $changed_icons || EXITCODE=$?; }
|
||||
|
||||
exit $EXITCODE
|
||||
Reference in New Issue
Block a user