-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
initial support for commands to use external binaries #1961
Conversation
Also |
@lgierth maybe in the future. Right now its done via whitelisting commands manually (the easiest route). The git style subcommand extension is really nice, but we do want to be careful with what 'our tool' does, if the user has an out of date |
448e775
to
ae0a45a
Compare
There is a related discussion currently on the Git mailing list: http://thread.gmane.org/gmane.comp.version-control.git/281124 |
External commands are wired in git alias through the '!' prefix. This is explicit, and I don't think any user would mistakenly mix between the built-in tools and the external ones. |
@rht if i make a script named I want to make sure that running the ipfs tool doesn't accidentally cause bad things. |
In that case, it does 'look' like git did it, but git still allows such script. Maybe because people have done less bad things through git than through the web. And I take it that ipfs, in the context as a git+web, is restricted (of what it allows people can do) by the potential bad things people would do through the web? Would be nice to have the shorthand aliases, though it is not required to deliver ipfs-update. |
@rht yeah, i'm not totally against having the mechanism be more generic, but i definitely think it needs some more thought. For now, this works so we can ship ipfs-update, in the future we can look at making it more extensible. |
if req.Arguments()[0] == "--help" { | ||
buf := new(bytes.Buffer) | ||
fmt.Fprintf(buf, "%s is an 'external' command.\n", binname) | ||
fmt.Fprintf(buf, "it does not currently appear to be installated.\n") |
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.
"installed"
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.
installificated!
@whyrusleeping this LGTM. but should the ipfs-update bin be referenced (at least with gx so it's pinned?) not sure. |
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
@jbenet for now, i'm thinking that we use gobuilder for |
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
ae0a45a
to
2d2aa66
Compare
@@ -76,6 +76,11 @@ dependencies as well. | |||
* Shell command completion is available in `misc/completion/ipfs-completion.bash`. Read [docs/command-completion.md](docs/command-completion.md) to learn how to install it. | |||
* See the [init examples](https://github.com/ipfs/examples/tree/master/examples/init) for how to connect IPFS to systemd or whatever init system your distro uses. | |||
|
|||
### Updating | |||
ipfs has an updating tool that can be accessed through `ipfs update`. The tool is | |||
not installed alongside ipfs in order to keep that logic indepedent of the main |
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.
"independent"
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.
good catch.
@jbenet final thoughts here? Lets merge this so we can ship 0.3.10 |
@@ -262,3 +269,67 @@ func checkArgValue(v string, found bool, def Argument) error { | |||
func ClientError(msg string) error { | |||
return &Error{Code: ErrClient, Message: msg} | |||
} | |||
|
|||
func ExternalBinary() *Command { |
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 whole function is very ipfs-specific. it does not belong in the commands lib
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.
(or make it general, but may be harder atm)
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.
addressed.
responded |
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
@jbenet LGTY? |
@whyrusleeping LGTM |
initial support for commands to use external binaries
Allows us to have
ipfs-update
as a separate binary be called asipfs update
License: MIT
Signed-off-by: Jeromy jeromyj@gmail.com