build: only format JS if files in web/ change (#5525)

In many cases the webui code is not updated for core libtransmission
changes and changes in the utils/clients. Therefore, check to see if any
web changes are made before running npm linting.

Co-authored-by: LaserEyess <LaserEyess@users.noreply.github.com>
This commit is contained in:
LaserEyess
2023-05-14 19:53:34 -04:00
committed by GitHub
parent 2cf9678737
commit 84f32d89c8

View File

@@ -76,6 +76,8 @@ if [ -n "$fix" ]; then
fi
# format JS
# but only if js has changed
git diff --cached --quiet -- "web/**" && exit $exitcode
cd "${root}/web" || exit 1
npm_lint_args="$([ -n "$fix" ] && echo 'lint:fix' || echo 'lint')"
if ! npm ci --no-audit --no-fund --no-progress &>/dev/null; then