up
This commit is contained in:
1
.husky/.gitignore
vendored
Normal file
1
.husky/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
_
|
||||
9
.husky/commit-msg
Executable file
9
.husky/commit-msg
Executable file
@@ -0,0 +1,9 @@
|
||||
|
||||
if [ -z "$(cat "$1" | grep -E '(^fix:)|(^feature:)|(^up$)|^Merge branch .+$')" ] ; then
|
||||
echo ""
|
||||
echo respecte le format de commit ❤
|
||||
echo " fix: xxx"
|
||||
echo " feature: xxx"
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
7
.husky/post-merge
Executable file
7
.husky/post-merge
Executable file
@@ -0,0 +1,7 @@
|
||||
|
||||
if git diff --name-only HEAD@{1} HEAD | grep package-lock.json ; then
|
||||
echo "📦 package-lock.json changed. Running npm ci to update your dependencies..."
|
||||
npm ci
|
||||
else
|
||||
echo "📦 no need to update dependencies"
|
||||
fi
|
||||
13
.husky/pre-commit
Executable file
13
.husky/pre-commit
Executable file
@@ -0,0 +1,13 @@
|
||||
|
||||
# prevent commits on master
|
||||
branch="$(git rev-parse --abbrev-ref HEAD)"
|
||||
if [ "$branch" = "master" ]; then
|
||||
echo ""
|
||||
echo "You can't commit directly to master branch"
|
||||
echo "please create a pull request"
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# run linters
|
||||
npx lint-staged
|
||||
Reference in New Issue
Block a user