-
Notifications
You must be signed in to change notification settings - Fork 236
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
Fixes bash command error when DESTDIR is a non-path directory #431
base: main
Are you sure you want to change the base?
Fixes bash command error when DESTDIR is a non-path directory #431
Conversation
Codecov Report
@@ Coverage Diff @@
## master #431 +/- ##
==========================================
- Coverage 32.77% 30.86% -1.92%
==========================================
Files 46 26 -20
Lines 5415 3201 -2214
==========================================
- Hits 1775 988 -787
+ Misses 3387 2119 -1268
+ Partials 253 94 -159
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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.
Thanks for your contribution! Sorry for the delay in reviewing your work.
If you still want this PR to be merged, can you please rebase it on main and address the comment I've left ?
Thank you for your time.
@@ -56,7 +56,7 @@ curl -sL --retry 3 "${RELEASE_URL}" | tar zx --strip 1 | |||
echo "Installing to $DESTDIR" | |||
install circleci "$DESTDIR" | |||
|
|||
command -v circleci | |||
command -v "$DESTDIR"circleci |
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.
We might want to remove any potential trailing /
in DESTDIR and force a /
before the binary name.
command -v "$DESTDIR"circleci | |
command -v "${DESTDIR%/}"/circleci |
Here are some helpful tips you can follow when submitting a pull request:
master
.make build
in the repository root.make test
).--debug
flag is often helpful for debugging HTTP client requests and responses.make lint
). Note: This requires Docker to run inside a local job.If you have any questions, feel free to ping us at @CircleCI-Public/x-team.
Problem
We found an issue with the install script on MacOS Catalina with bash 3.2 and Ubuntu 18 with bash 4.4, zsh 5.4.2.
When
DESTDIR
is set to a directory that is not inPATH
, CircleCI CLI will successfully install but the script will error out on line 59.Example output:
We suspect this is because
command
is being executed with no directory context. Meaning any install to a non-path directory will fail, causing the install script to fail.Testing
We have ran this locally on macOS Catalina with the following cases:
DESTDIR
and examining the exit code and status of the installed binary.All appears to work well in both cases.