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

add pin/unpin command #180

Merged
merged 6 commits into from
Oct 20, 2024
Merged

add pin/unpin command #180

merged 6 commits into from
Oct 20, 2024

Conversation

snwzd
Copy link
Contributor

@snwzd snwzd commented Nov 14, 2023

closes #126

@snwzd
Copy link
Contributor Author

snwzd commented Nov 14, 2023

I think pin/unpin is done for binaries, please tell me if there is anything that I should change.

@snwzd snwzd marked this pull request as ready for review November 14, 2023 17:15
@mbevc1
Copy link
Contributor

mbevc1 commented Jun 15, 2024

Probably related//solving to #177 too 🤔 ?

@@ -35,6 +35,7 @@ type Binary struct {
// the package path in config so we don't ask the user to select
// the path again when upgrading
PackagePath string `json:"package_path"`
Pin bool `json:"pin"`
Copy link
Owner

Choose a reason for hiding this comment

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

nit: rename to Pinned?

@marcosnils
Copy link
Owner

@snwzt I was coming back to bin after a while and I'd like to merge this. Any chance you could rebase? I'll commit to merge it afterwards!

cmd/pin.go Outdated

binaryList := make(map[string]*config.Binary)
for _, b := range cfg.Bins {
binaryList[b.RemoteName] = b
Copy link
Owner

Choose a reason for hiding this comment

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

This should use getBinPath similar to update here

bin, err := getBinPath(a)
so pin can be called either by the binary name or the path.

cmd/unpin.go Outdated

binaryList := make(map[string]*config.Binary)
for _, b := range cfg.Bins {
binaryList[b.RemoteName] = b
Copy link
Owner

Choose a reason for hiding this comment

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

cmd/update.go Outdated
@@ -59,6 +59,9 @@ func newUpdateCmd() *updateCmd {
if err != nil {
return err
}
if cfg.Bins[bin].Pin {
Copy link
Owner

Choose a reason for hiding this comment

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

Print an info message here instead of returning an error is better as otherwise, this will interrupt the whole update process.

@snwzd snwzd marked this pull request as draft October 20, 2024 13:05
@snwzd snwzd marked this pull request as ready for review October 20, 2024 14:01
@snwzd
Copy link
Contributor Author

snwzd commented Oct 20, 2024

Hi, I’ve rebased the branch and made the requested changes. Please tell me if there's anything that I should change.

@marcosnils marcosnils merged commit 94bbdca into marcosnils:master Oct 20, 2024
2 checks passed
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.

Implement version pinning
3 participants