Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow configuring a name for the archived binary #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

magni-
Copy link

@magni- magni- commented Jul 19, 2021

This will default to the existing behavior: using the name of the currently running executable.

I don't write much Go, so hopefully I didn't do things too terribly 😬

Fixes #42

@magni-
Copy link
Author

magni- commented Jul 19, 2021

(Noticed the build failed but I'm at the end of my day, will take a closer look tomorrow 🙇🏼)

@magni- magni- marked this pull request as draft July 19, 2021 08:40
This will default to the existing behavior: using the name of the currently running executable.

Fixes rhysd#42
@magni- magni- marked this pull request as ready for review July 20, 2021 04:07
@@ -11,16 +11,34 @@ import (
"github.com/blang/semver"
)

func setupTestBinary() {
if err := exec.Command("go", "build", "./testdata/github-release-test/").Run(); err != nil {
func setupTestBinary(name ...string) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes in here and teardownTestBinary feel a bit hacky. An alternative I considered was using a new repo (i.e rhysd-test/test-release-different-name) which would have contained an archive with a differently named binary, and thus we could leave these two methods here as-is.

Do you have a preference @rhysd ?

@magni-
Copy link
Author

magni- commented Aug 20, 2021

FWIW, this is merged in our fork (rainforestapp/go-github-selfupdate) and used by our CLI (see PR implementing it here: https://github.com/rainforestapp/rainforest-cli/pull/413/files), so I can confirm this works in the real world 😅

@wtrocki
Copy link

wtrocki commented Apr 11, 2022

Yes. This repo seems to be no longer maintained. I will move to use yours @magni-

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Setting the archive binary name
2 participants