-
Notifications
You must be signed in to change notification settings - Fork 10
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
runner: support shell parameter #28
Conversation
Doc is missing though. If you are happy with the changes, I can then add the doc. |
Codecov Report
@@ Coverage Diff @@
## master #28 +/- ##
========================================
Coverage ? 93.3%
========================================
Files ? 7
Lines ? 224
Branches ? 0
========================================
Hits ? 209
Misses ? 7
Partials ? 8
Continue to review full report at Codecov.
|
Interesting option 😃 However, I think running Orbit as mentioned in my comment on issue #27 should be the actual way of doing that. Still, an interesting option... |
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.
Some minor changes and I think we're good :)
app/runner/runner.go
Outdated
@@ -46,6 +47,10 @@ type ( | |||
// printing the available tasks. | |||
Private bool `yaml:"private,omitempty"` | |||
|
|||
// Shell allows to choose which binary will | |||
// be called to run the commands |
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.
Point required at the end of the sentence #grammarNazi
app/runner/runner_test.go
Outdated
t.Error("Custom shell task should have failed!") | ||
} | ||
|
||
// case 5: uses custom shell with existent shell. |
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.
case 6 here :)
if task.Shell != "" { | ||
shellAndParams := strings.Fields(task.Shell) | ||
shell := shellAndParams[0] | ||
parameters := append(shellAndParams[1:], cmd) |
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.
I think we should check the numbers of field (if == 1, this won't work)
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.
Not sure about that: ariane
test works correctly, right?
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.
Indeed... missed it!
- You can now pass a shell parameter to your run task - support multiple words commands, such as `bash -c` - added failing an successful tests
🎉 ! |
Summary
This PR allows the user to choose a shell to run the task.
shell
support single or multiple commands to run the shell:Run using bash:
This PR implements the following feature:
run
expected shell #27Fixes #27
Checklist
orbit run fmt
)?orbit run ci
)?