cheton / github-release-cli

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

Body overwritten when --body not specified #8

Closed dougnorton closed 5 years ago

dougnorton commented 5 years ago

We call upload from multiple build machines for each release. Only one of those uploads contain a body. Any call to upload that doesn't include a body causes the body of the release to be overwritten with an empty string. Could you not write body if it's empty? For example:

case 22:
    var data = {
        owner: owner,
        repo: repo,
        release_id: release.id,
        tag_name: tag,
        name: name || tag,
        draft: draft === undefined ? !!release.draft : false,
        prerelease: prerelease === undefined ? !!release.prerelease : false
    };
    var body = (body === undefined ? release.body || '' : body || '');

    if(body !== '')
        data['body'] = body;
    console.log('> updateRelease: release_id=' + release.id + ', tag_name=' + tag + ', name=' + (name || tag));
    _context.next = 25;
    return octokit.repos.updateRelease(data);
cheton commented 5 years ago

Thank you for reporting this issue. It shall be fixed in 1.1.0.

dougnorton commented 5 years ago

thank-you, works great!