-
Notifications
You must be signed in to change notification settings - Fork 138
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
Consider supporting command args with JSON Array #37
Comments
I like where you're going with the overall concept here but I think supporting two different field names is inelegant. I'd love if we could do something like what the Docker folks did with the The typical way to do this would be to deserialize the JSON into If we weren't going to do that, then I'd say we just break backwards compat (this is still marked alpha) and use a JSON array that will sometimes be a one-argument array. But if we can make the former work that'd be ideal. |
I should probably point out that we'll probably need to do pre-processing via |
@tgross I agree. Originally I wanted to do something like you described (supporting both arrays and strings) but I wasn't sure how to. Thanks for the reference. I'll revisit this tonight and see if I come up with something. |
@tgross I've implemented the enhancement as suggested. I'm not sure how you want to handle #16 though - since it kind of seems like the implementation strategy is still up in the air. Also, it seemed like it would be good to support the string/array for interfaces as well - so if you only want to provide 1 interface, it doesn't need to be wrapped in an array. |
Let's not worry about that for now; what you have here provides the places to hook-in for whomever is going to implement that nicely. |
This has been merged and will be in the next release (presumably 0.0.5). Thanks @justenwalker! |
All commands in the app.json are just strings. Currently, Containerbuddy splits these strings on space.
This could be fragile if the command requires an argument to have a space.
This leaves three options:
Proposal
Supporting a JSON array of arguments makes practical sense:
Commands & arguments
All executable fields, such as
onStart
andonChange
, accept both a string or an array. If a string is given, the command and its arguments are separated by spaces; otherwise, the first element of the array is the command path, and the rest are its arguments.String Command
Array Command
The text was updated successfully, but these errors were encountered: