Skip to content

Commit cce002e

Browse files
committed
chore: add back conventinal commits check
1 parent 4d0c390 commit cce002e

File tree

5 files changed

+19
-17
lines changed

5 files changed

+19
-17
lines changed

.husky/post-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
23
flag_file_path='.version-update'
34

45
if [ -f $flag_file_path ]; then

.husky/prepare-commit-msg

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,30 @@ if [ -f $flag_file_path ]; then
88
exit 0
99
fi
1010

11-
if [ ! $(git branch --show-current) = 'main' ]; then
11+
if [ $(git branch --show-current) != 'main' ]; then
1212
exit 0
1313
fi
1414

1515
# types
16-
commit_types='^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)'
17-
minor_types='^(build|feat|revert)'
18-
patch_types='^(chore|fix|perf|refactor)'
19-
2016
parens='(\(\w+\))?'
2117
msg=':\s.+'
18+
opt_exclam='!?'
19+
exclam='!'
20+
21+
commit_types='^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)'$parens
22+
minor_types='^(build|feat|revert)'$parens$msg
23+
patch_types='^(chore|fix|perf|refactor)'$parens$msg
2224

2325
version_match='"version": *"[0-9.]\+"'
2426
version_str='"version": '
2527

2628
# read message to var
2729
commit_msg=$(cat $1)
2830

29-
# TODO: fix this, as it does not work...
30-
#if [[ $commit_msg =~ $commit_types$parens'!?'$msg ]]; then
31-
# echo 'Use Conventional Commits: https://conventionalcommits.org'
32-
# exit 1
33-
#fi
31+
if ! [[ $commit_msg =~ $commit_types$opt_exclam$msg ]]; then
32+
echo 'Use Conventional Commits: https://conventionalcommits.org'
33+
exit 1
34+
fi
3435

3536
# bump version function
3637
bumpVersion() {
@@ -42,13 +43,13 @@ bumpVersion() {
4243
}
4344

4445
# version change type
45-
if [[ $commit_msg =~ $commit_types$parens'!'$msg ]]; then
46+
if [[ $commit_msg =~ $commit_types$exclam$msg ]]; then
4647
bumpVersion major
4748
else
48-
if [[ $commit_msg =~ $minor_types$parens$msg ]]; then
49+
if [[ $commit_msg =~ $minor_types ]]; then
4950
bumpVersion minor
5051
else
51-
if [[ $commit_msg =~ $patch_types$parens$msg ]]; then
52+
if [[ $commit_msg =~ $patch_types ]]; then
5253
bumpVersion patch
5354
fi
5455
fi

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "Replace Maps iframes with OSM",
44
"author": "nobkd",
55
"license": "Unlicense",
6-
"version": "1.1.3",
6+
"version": "1.1.4",
77
"type": "module",
88
"homepage": "https://github.com/nobkd/replace-maps#readme",
99
"bugs": {

public/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"description": "Replace Maps iframes with OSM",
33
"manifest_version": 2,
44
"name": "Replace Maps",
5-
"version": "1.1.3",
5+
"version": "1.1.4",
66
"homepage_url": "https://github.com/nobkd/replace-maps",
77
"icons": {
88
"48": "icons/48.png",

0 commit comments

Comments
 (0)