-
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
Allow ensure
to accept binary parameter, as done in update
#167
Comments
fixes #167 Signed-off-by: Marcos Lilljedahl <marcosnils@gmail.com>
fixes #167 Signed-off-by: Marcos Lilljedahl <marcosnils@gmail.com>
fixed and 🚢 in v0.17.0 thanks for the feedback! |
Thanks, @marcosnils. However, I'm experiencing problems (two different systems): 🕙[ 09:00:42 PM ] 🎯 ❯ bin e --debug ~/.local/bin/rclone
• debug logs enabled, version: 0.17.0
commit: 00e1249bd86fa32c5cde053c8f19afb6efd1c95f
built at: 2023-07-19T01:30:30Z
built by: goreleaser
• Config directory is: /home/amontero/.config/bin
• Download path set to $HOME/.local/bin
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xac4d18]
goroutine 1 [running]:
github.com/marcosnils/bin/cmd.newEnsureCmd.func1(0xc00037cc00?, {0xc000452500, 0x1, 0x2?})
/home/marcos/Projects/bin/cmd/ensure.go:48 +0x118
github.com/spf13/cobra.(*Command).execute(0xc00037cc00, {0xc0004524e0, 0x2, 0x2})
/home/marcos/Projects/gopath/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:916 +0x862
github.com/spf13/cobra.(*Command).ExecuteC(0xc00037c600)
/home/marcos/Projects/gopath/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:1044 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
/home/marcos/Projects/gopath/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:968
github.com/marcosnils/bin/cmd.(*rootCmd).Execute(0xc0000a12a8, {0xc0000aa050, 0x3, 0xb4f060?})
/home/marcos/Projects/bin/cmd/root.go:35 +0x165
github.com/marcosnils/bin/cmd.Execute({0xc0000fe1c0, 0x6b}, 0xdf22a0?, {0xc0000aa050, 0x3, 0x3})
/home/marcos/Projects/bin/cmd/root.go:25 +0xbb
main.main()
/home/marcos/Projects/bin/main.go:21 +0x97 Another, different host: pataquets@cloudshell:~ $ bin --debug e ~/.local/bin/rclone
• debug logs enabled, version: 0.17.0
commit: 00e1249bd86fa32c5cde053c8f19afb6efd1c95f
built at: 2023-07-19T01:30:30Z
built by: goreleaser
• Config directory is: /home/pataquets/.config/bin
• Download path set to $HOME/.local/bin
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xac4d18]
goroutine 1 [running]:
github.com/marcosnils/bin/cmd.newEnsureCmd.func1(0xc0002fcc00?, {0xc0003d4500, 0x1, 0x2?})
/home/marcos/Projects/bin/cmd/ensure.go:48 +0x118
github.com/spf13/cobra.(*Command).execute(0xc0002fcc00, {0xc0003d44e0, 0x2, 0x2})
/home/marcos/Projects/gopath/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:916 +0x862
github.com/spf13/cobra.(*Command).ExecuteC(0xc0002fc600)
/home/marcos/Projects/gopath/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:1044 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
/home/marcos/Projects/gopath/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:968
github.com/marcosnils/bin/cmd.(*rootCmd).Execute(0xc000097278, {0xc0000a2050, 0x3, 0xb4f060?})
/home/marcos/Projects/bin/cmd/root.go:35 +0x165
github.com/marcosnils/bin/cmd.Execute({0xc0000fc1c0, 0x6b}, 0xdf22a0?, {0xc0000a2050, 0x3, 0x3})
/home/marcos/Projects/bin/cmd/root.go:25 +0xbb
main.main()
/home/marcos/Projects/bin/main.go:21 +0x97 |
can you try with |
Sure. Here you are: $ bin | grep rclone
/home/amontero/.local/bin/rclone v1.62.2 github.com/rclone/rclone OK
$ which rclone
/home/amontero/.local/bin/rclone
$ rclone --version
rclone v1.62.2
- os/version: ubuntu 18.04 (64 bit)
- os/kernel: 4.15.0-213-generic (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.20.2
- go/linking: static
- go/tags: none
$ bin -e rclone
⨯ command failed error=unknown shorthand flag: 'e' in -e
$ bin e rclone
$ bin e --debug rclone
• debug logs enabled, version: 0.17.0
commit: 00e1249bd86fa32c5cde053c8f19afb6efd1c95f
built at: 2023-07-19T01:30:30Z
built by: goreleaser
• Config directory is: /home/amontero/.config/bin
• Download path set to $HOME/.local/bin
$ rclone --version
rclone v1.62.2
- os/version: ubuntu 18.04 (64 bit)
- os/kernel: 4.15.0-213-generic (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.20.2
- go/linking: static
- go/tags: none Checked it, and there's a newer |
wait, but That's why when you're doing |
Sorry, I've tested with the wrong binary 🤦 (both hosts have rclone) $ rm ~/.local/bin/rclone
$ bin -e rclone
⨯ command failed error=unknown shorthand flag: 'e' in -e
$ bin e rclone
• Getting latest release for rclone/rclone
• Starting download of https://api.github.com/repos/rclone/rclone/releases/assets/117582938
17.14 MiB / 17.14 MiB [--------------------------------------------------------------------------------------] 100.00% 656.43 KiB p/s 27s
Multiple matches found, please select one:
[1] rclone-v1.63.1-linux-amd64/README.html
[2] rclone-v1.63.1-linux-amd64/README.txt
[3] rclone-v1.63.1-linux-amd64/git-log.txt
[4] rclone-v1.63.1-linux-amd64/rclone
[5] rclone-v1.63.1-linux-amd64/rclone.1
Select an option: 4
• Copying for rclone@v1.63.1 into /home/amontero/.local/bin/rclone
• Done ensuring $HOME/.local/bin/rclone to v1.62.2
$ rclone --version
rclone v1.63.1
- os/version: ubuntu 18.04 (64 bit)
- os/kernel: 4.15.0-213-generic (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.20.6
- go/linking: static
- go/tags: none Works as intended, and no panic. |
After deleting |
@marcosnils Another clue: something similar happens with |
please try removing the binary and running |
It's done above, afaict (and it worked). If you need something different, let me know. |
gotcha perfect. I'll check the panic bug afterwards then. Just wanted to check that worked for you. |
Sure. Thank you very much! |
Having a bin configuration shared between several machines, but not all binaries needed on all of machines.
The idea would be, for instance, to use
bin e rclone
only on machines where it's needed.The text was updated successfully, but these errors were encountered: