Skip to content

Commit

Permalink
fix: only change version on main
Browse files Browse the repository at this point in the history
  • Loading branch information
nobkd committed Apr 14, 2023
1 parent 92c256b commit 654cb6f
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .husky/post-commit
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
flag_file_path='./.version-update'
flag_file_path='.version-update'

if [ -f $flag_file_path ]; then
git add package.json package-lock.json public/manifest.json
Expand Down
9 changes: 9 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

flag_file_path='.version-update'

if [ -f $flag_file_path ]; then
npm run format > /dev/null
fi

exit 0
12 changes: 7 additions & 5 deletions .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
#!/bin/bash

flag_file_path='./.version-update'
# If this file exists when entering the script, it means the version was already
# updated and we did a commit amend to update package.json and package-lock.json,
# so we must delete the file and exit the script.
flag_file_path='.version-update'

# check if commit amend or normal commit
if [ -f $flag_file_path ]; then
rm $flag_file_path
exit 0
fi

npm run format
touch $flag_file_path

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

# types
commit_types='^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)'
minor_types='^(build|feat|revert)'
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Replace Maps iframes with OSM",
"author": "nobkd",
"license": "Unlicense",
"version": "1.1.0",
"version": "1.1.1",
"type": "module",
"homepage": "https://github.com/nobkd/replace-maps#readme",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"description": "Replace Maps iframes with OSM",
"manifest_version": 2,
"name": "Replace Maps",
"version": "1.1.0",
"version": "1.1.1",
"homepage_url": "https://github.com/nobkd/replace-maps",
"icons": {
"48": "icons/48.png",
Expand Down

0 comments on commit 654cb6f

Please sign in to comment.