Skip to content

Commit 68667e0

Browse files
Merge pull request #3052 from balena-io/vipulgupta2048/add-husky
Add Husky pre-commit: Convert all images to Webp
2 parents 8d66f6a + e1e82a1 commit 68667e0

File tree

4 files changed

+21
-2
lines changed

4 files changed

+21
-2
lines changed

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
./tools/convert-images-to-webp.sh

package-lock.json

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"deploy-docs": "npm ci && npm run build",
1818
"watch-pages": "watch ./tools/build.sh pages shared templates config",
1919
"watch-assets": "webpack --mode=development -w",
20-
"watch": "npm run watch-pages & npm run watch-assets"
20+
"watch": "npm run watch-pages & npm run watch-assets",
21+
"prepare": "husky"
2122
},
2223
"repository": {
2324
"type": "git",
@@ -47,6 +48,7 @@
4748
"cspell": "^8.9.1",
4849
"css-loader": "5.2.7",
4950
"file-loader": "6.2.0",
51+
"husky": "^9.1.4",
5052
"mini-css-extract-plugin": "^1.6.2",
5153
"node-html-markdown": "^1.3.0",
5254
"node-jq": "^4.4.0",

tools/convert-images-to-webp.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ find "$IMAGE_DIR" -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png"
3333
else
3434
echo "Failed to convert: $FILE"
3535
fi
36-
done
36+
done

0 commit comments

Comments
 (0)