-
Notifications
You must be signed in to change notification settings - Fork 47
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
Conversation
61de57b
to
47781e6
Compare
I think pin/unpin is done for binaries, please tell me if there is anything that I should change. |
Probably related//solving to #177 too 🤔 ? |
pkg/config/config.go
Outdated
@@ -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"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: rename to Pinned?
@snwzt I was coming back to |
cmd/pin.go
Outdated
|
||
binaryList := make(map[string]*config.Binary) | ||
for _, b := range cfg.Bins { | ||
binaryList[b.RemoteName] = b |
There was a problem hiding this comment.
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
Line 58 in 91ae3e6
bin, err := getBinPath(a) |
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 |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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.
Hi, I’ve rebased the branch and made the requested changes. Please tell me if there's anything that I should change. |
closes #126