Closed Crementif closed 6 years ago
Use a function to parse the optional value of draft
and prerelease
options can definitely fix the issue by specifying either --prerelease=false
or --prerelease false
. I will make the change if you're fine with it.
program
.version(pkg.version)
.usage('<command> [<args>]')
.option('-T, --token <token>', 'OAuth2 token')
.option('-o, --owner <owner>', 'owner')
.option('-r, --repo <repo>', 'repo')
.option('-t, --tag <tag>', 'tag')
.option('-n, --name <name>', 'name')
.option('-b, --body <body>', 'body', false)
.option('-d, --draft [value]', 'draft', function(val) {
if (String(val).toLowerCase() === 'false') {
return false;
}
return true;
})
.option('-p, --prerelease [value]', 'prerelease', function(val) {
if (String(val).toLowerCase() === 'false') {
return false;
}
return true;
});
Published v0.4.1
github-release upload \
--owner cheton \
--repo github-release-cli \
--tag "v0.1.0" \
--name "v0.1.0" \
--body "This is a prerelease" \
--prerelease
github-release upload \
--owner cheton \
--repo github-release-cli \
--tag "v0.1.0" \
--name "v0.1.0" \
--body "This is a published release" \
--prerelease=false
Let me know if it works for you. Thanks.
Woah, thanks for the quick response and implementation. It's exactly what I needed.
Thanks for all the work you've put into this module!
I'm happy to report that it's working in my project.
Is there any future plans for supporting this? Maybe a possibility of specifying
--prerelease false
would do this? Tell me if you've got any ideas, I'm probably able to make a pull request.