Skip to content

Commit

Permalink
chore: set up pre-commit hook for automatic builds on commit with Husky
Browse files Browse the repository at this point in the history
I've been using a custom git hook to achieve this for some time now, but
Husky allows automatically setting up git for it and sharing it.
  • Loading branch information
AlexTMjugador committed Mar 30, 2023
1 parent 898ae0c commit 0c58a3b
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 22 deletions.
5 changes: 5 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh -e
. "$(dirname -- "$0")/_/husky.sh"

npm run build
git add dist
2 changes: 1 addition & 1 deletion dist/main/index.js

Large diffs are not rendered by default.

52 changes: 34 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"format-check": "prettier --check .",
"test": "npm run build && act --secret-file .act-secrets -W .github/workflows/test_empty_resource_pack.yml",
"test:pack-in-submodule": "npm run build && act --secret-file .act-secrets -W .github/workflows/test_pack_in_submodule.yml",
"test:pack-submodule": "npm run build && act --secret-file .act-secrets -W .github/workflows/test_pack_submodule.yml"
"test:pack-submodule": "npm run build && act --secret-file .act-secrets -W .github/workflows/test_pack_submodule.yml",
"prepare": "husky install"
},
"repository": {
"type": "git",
Expand All @@ -27,11 +28,12 @@
"@typescript-eslint/eslint-plugin": "5.57.0",
"@typescript-eslint/parser": "5.57.0",
"@vercel/ncc": "0.36.1",
"all-contributors-cli": "6.24.0",
"eslint": "8.37.0",
"eslint-config-prettier": "8.8.0",
"husky": "8.0.3",
"prettier": "2.8.7",
"typescript": "5.0.2",
"all-contributors-cli": "6.24.0"
"typescript": "5.0.2"
},
"dependencies": {
"@actions/artifact": "1.1.1",
Expand Down

0 comments on commit 0c58a3b

Please sign in to comment.