cheton / github-release-cli

A command-line tool for managing release assets on a GitHub repository.
MIT License
72 stars 17 forks source link

Not possible to edit a prerelease to a published release #2

Closed Crementif closed 6 years ago

Crementif commented 6 years ago

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.

cheton commented 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;
    });
cheton commented 6 years ago

Published v0.4.1

Create a prerelease

github-release upload \
  --owner cheton \
  --repo github-release-cli \
  --tag "v0.1.0" \
  --name "v0.1.0" \
  --body "This is a prerelease" \
  --prerelease

Change a prerelease to a published release

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.

Crementif commented 6 years ago

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!

Crementif commented 6 years ago

I'm happy to report that it's working in my project.