Skip to content

Commit 5ed9b2a

Browse files
committed
feat: support -o|--organize option to control changelog
1 parent e4b596d commit 5ed9b2a

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

please

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,21 @@ $(ok Scope:)
5555
$(info minor) $(comment "Bumps the <minor> part of semver.")
5656
5757
$(ok Options:)
58-
$(info "-c --chlog") $(comment "Forces creation of CHANGELOG.md file.")
59-
$(info "-h --help") $(comment "Show help information and usage.")
60-
$(info "-H --chash") $(comment "Prepends commit hash into log.")
61-
$(info "-p --public") $(comment "Set scoped npm package for public access.")
62-
$(info "-u --update") $(comment "Update ${PLIZ} to latest version.")
63-
$(info "-v --vfile") $(comment "Forces creation of VERSION file.")
64-
$(info "-V --version") $(comment "Forces the exact version to be released.")
65-
$(info "-y --yes") $(comment "Assume yes for any confirmation.")
58+
$(info "-c --chlog") $(comment "Forces creation of CHANGELOG.md file.")
59+
$(info "-h --help") $(comment "Show help information and usage.")
60+
$(info "-H --chash") $(comment "Prepends commit hash into log.")
61+
$(info "-o --organize") $(comment "Commit types as CSV for changelog or release notes.")
62+
$(comment "(Default: feat,fix,refactor,perf,docs,infra,chore)")
63+
$(info "-p --public") $(comment "Set scoped npm package for public access.")
64+
$(info "-u --update") $(comment "Update ${PLIZ} to latest version.")
65+
$(info "-v --vfile") $(comment "Forces creation of VERSION file.")
66+
$(info "-V --version") $(comment "Forces the exact version to be released.")
67+
$(info "-y --yes") $(comment "Assume yes for any confirmation.")
6668
6769
$(ok Examples:)
6870
please
6971
please --update
72+
please --organize feat,fix,docs # only features, fixes and docs are included
7073
please --vfile --chash
7174
please minor --public --yes
7275
please major --vfile --chlog
@@ -76,7 +79,7 @@ USAGE
7679
}
7780

7881
# organize commits
79-
organize-commits() # $1 = diff_range, $2 = commit_type
82+
organize-commits() # $1 = diff_range, $2 = commit_types_csv
8083
{
8184
declare -A LABELS=(
8285
[feat]=Features
@@ -214,6 +217,7 @@ do
214217
-H | --chash) GCFMT="${GCFMT} [_%h_](https://github.com/${REPO}/commit/%h)"; shift 1 ;;
215218
-y | --yes) YES=1; shift 1 ;;
216219
-V | --version) NEXT_VERSION=$2; shift 2 ;;
220+
-o | --organize) TYPES=$2; shift 2 ;;
217221
minor) MINOR=1; shift 1 ;;
218222
major) MAJOR=1; shift 1 ;;
219223
*) error "Invalid arg ${1}. (Run ${PLIZ} --help)"; exit 1 ;;
@@ -265,7 +269,7 @@ fi
265269
ok " Done [${VERSION}]"
266270
267271
info "Collecting commits ..."
268-
COMMITS=`organize-commits "$RANGE"`
272+
COMMITS=`organize-commits "$RANGE" "$TYPES"`
269273
ok
270274
271275
if [ "" == "$COMMITS" ]; then

0 commit comments

Comments
 (0)