@@ -47,21 +47,16 @@ github()
47
47
usage ()
48
48
{
49
49
cat << USAGE
50
- ${PLIZ} $( info ` version` ) | $( ok " (c) Jitendra Adhikari" )
51
- ${PLIZ} is github release made easy. If you embrace semver this is the right tool.
50
+ ${PLIZ} $( info ` version` ) | $( ok " (c) Jitendra Adhikari" ) | ${PLIZ} is semver release made easy.
52
51
53
- $( ok Usage:)
54
- ${PLIZ} [command]
55
- ${PLIZ} [scope] [--options]
52
+ $( ok Usage:) ${PLIZ} [command|scope] [--options]
56
53
57
54
$( ok Commands:)
58
- $( info version) $( comment " Print current version of itself." )
59
- $( info help) $( comment " Show help information and usage." )
60
-
55
+ $( info version) $( comment " Print current version of itself." )
56
+ $( info help) $( comment " Show help information and usage examples." )
61
57
$( ok Scope:)
62
- $( info major) $( comment " Bumps the <major> part of semver." )
63
- $( info minor) $( comment " Bumps the <minor> part of semver." )
64
-
58
+ $( info major) $( comment " Bumps the <major> part of semver." )
59
+ $( info minor) $( comment " Bumps the <minor> part of semver." )
65
60
$( ok Options:)
66
61
$( info " -c --chlog" ) $( comment " Forces creation of CHANGELOG.md file." )
67
62
$( info " -h --help" ) $( comment " Show help information and usage." )
@@ -73,17 +68,29 @@ $(ok Options:)
73
68
$( info " -v --vfile" ) $( comment " Forces creation of VERSION file." )
74
69
$( info " -V --version" ) $( comment " Forces the exact version to be released." )
75
70
$( info " -y --yes" ) $( comment " Assume yes for any confirmation." )
71
+ $( ok Events:)
72
+ $( info " --before-all" ) $( comment " Run the command before anything (very start)." )
73
+ $( info " --before-npm" ) $( comment " Run the command before releasing to npm." )
74
+ $( info " --before-push" ) $( comment " Run the command before pushing code to remote." )
75
+ $( info " --before-vcs" ) $( comment " Run the command before releasing to VCS." )
76
+ $( info " --after-all" ) $( comment " Run the command after everything finishes." )
77
+ (See https://github.com/adhocore/please#events for more info)
78
+ USAGE
76
79
80
+ if [ " $1 " == " help" ]; then
81
+ cat << EXAMPLE
77
82
$( ok Examples:)
78
- please
79
- please version $( comment " # prints current version of itself" )
80
- please --update $( comment " # updates please if new version available" )
81
- please --organize feat,fix,docs $( comment " # includes only features, fixes and docs" )
82
- please --vfile --chash $( comment " # creates VERSION file, adds commit hash" )
83
- please minor --public --yes $( comment " # releases minor version without asking" )
84
- please major --vfile --chlog $( comment " # releases next major version with VERSION and CHANGELOG files" )
85
- please --vfile --chlog --version 1.5.0 $( comment " # releases version 1.5.0 with VERSION and CHANGELOG files" )
86
- USAGE
83
+ ${PLIZ}
84
+ ${PLIZ} version $( comment " # prints current version of itself" )
85
+ ${PLIZ} --update $( comment " # updates ${PLIZ} if new version available" )
86
+ ${PLIZ} --organize feat,fix,docs $( comment " # includes only features, fixes and docs" )
87
+ ${PLIZ} --vfile --chash $( comment " # creates VERSION file, adds commit hash" )
88
+ ${PLIZ} minor --public --yes $( comment " # releases minor version without asking" )
89
+ ${PLIZ} major --vfile --chlog $( comment " # releases next major version with VERSION and CHANGELOG files" )
90
+ ${PLIZ} --vfile --chlog --version 1.5.0 $( comment " # releases version 1.5.0 with VERSION and CHANGELOG files" )
91
+ ${PLIZ} --before-all 'echo {REPO}' $( comment " # before release, runs 'echo {REPO}' with REPO interpolated" )
92
+ EXAMPLE
93
+ fi
87
94
exit 0
88
95
}
89
96
@@ -192,7 +199,6 @@ publish-phar()
192
199
https://uploads.${GH_REPO} /releases/${LAST_RELEASE_ID} /assets?name=${NAME} " \
193
200
| jq -r ' .size' `
194
201
ok
195
-
196
202
info " [OK] ${NAME} ${SIZE} bytes"
197
203
}
198
204
244
250
while [[ $# -gt 0 ]]
245
251
do
246
252
case " $1 " in
247
- -h | --help | help) usage ;;
253
+ -h | --help | help) usage $1 ;;
248
254
-u | --update) update ;;
249
255
-v | --vfile) VFILE=1; shift 1 ;;
250
256
-p | --public) PUBLIC=" --access=public" ; shift 1 ;;
@@ -388,7 +394,7 @@ if [[ $GPUSH -eq 1 ]]; then
388
394
fi
389
395
390
396
# github release
391
- trigger before-github
397
+ trigger before-vcs
392
398
info " Releasing $NEXT_VERSION ..."
393
399
COMMITS=` printf %s " $COMMITS " `
394
400
LAST_RELEASE_ID=` curl --silent -H " Authorization: token ${GH_AUTH_TOKEN} " \
0 commit comments