-
Notifications
You must be signed in to change notification settings - Fork 52
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
Filter out empty elements when creating command strings #609
Conversation
Codecov Report
@@ Coverage Diff @@
## master #609 +/- ##
==========================================
+ Coverage 38.28% 38.83% +0.55%
==========================================
Files 2 2
Lines 222 224 +2
Branches 42 43 +1
==========================================
+ Hits 85 87 +2
Misses 137 137
Continue to review full report at Codecov.
|
9234e55
to
5eaeba0
Compare
Signed-off-by: Christophe Bedard <bedard.christophe@gmail.com>
5eaeba0
to
ecee94e
Compare
Looking at the tests now, it all looks good. |
src/action-ros-ci.ts
Outdated
@@ -467,7 +467,9 @@ done`; | |||
`--packages-up-to ${packageNames}`, | |||
`${extra_options.join(" ")}`, | |||
extraCmakeArgs !== "" ? `--cmake-args ${extraCmakeArgs}` : "", | |||
].join(" "); | |||
] | |||
.filter((e) => e.length > 0) |
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.
these are all fine, but now that we are doing it 4 times, i wonder if a utility function would be warranted, e.g.
function filterNonEmptyJoin(values: List) {
return values.filter((v) => v.length > 0).join(" ")
}
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.
sure I can do that!
I can even add a test 😁
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.
Signed-off-by: Christophe Bedard <bedard.christophe@gmail.com>
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.
nice, thanks
Follow-up to #608, which didn't fix every occurrence.