From 106ae8370e54f428d653f3379e528c3a9fe5d609 Mon Sep 17 00:00:00 2001 From: Nate W Date: Wed, 21 Aug 2024 18:52:52 -0700 Subject: [PATCH] adding diff checks Signed-off-by: Nate W --- package.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package.json b/package.json index 3dc9a3248..3086978a7 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,8 @@ "scripts": { "_build": "hugo --cleanDestinationDir -e dev -DFE", "_check-links": "make check-links", + "_diff:check": "git diff --name-only --exit-code", + "_diff:fail": "git diff --name-only --exit-code || exit 1", "_serve:hugo": "hugo serve -DFE --minify", "_serve": "netlify dev -c \"npm run _serve:hugo\" --framework hugo", "build:preview": "set -x && npm run _build -- --minify --baseURL \"${DEPLOY_PRIME_URL:-/}\"", @@ -10,6 +12,8 @@ "check-links:all": "HTMLTEST_ARGS= npm run _check-links", "check-links": "npm run _check-links", "clean": "make clean", + "diff:check": "npm run _diff:check || (echo; echo 'WARNING: the files above have not been committed'; echo)", + "diff:fail": "npm run _diff:check || (echo; echo 'ERROR: the files above have changed. Locally rerun `npm run test-and-fix` and commit changes'; echo; exit 1)", "log:check:links": "npm run check-links | tee tmp/build-log.txt", "postbuild:preview": "npm run _check-links", "postbuild:production": "npm run _check-links",