This repository was archived by the owner on Jun 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 45
CB-13978: Show a warning when cbd looks up Profiles from the PATH. #739
Open
brycederriso
wants to merge
1
commit into
master
Choose a base branch
from
CB-13978
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Made a mistake, still testing this. |
Ganesh pointed out that this doesn't gracefully deal with Further, I'm getting errors when running this locally:
|
2882aba
to
dfbf773
Compare
dfbf773
to
243e71d
Compare
An example of the output:
It's not perfect, but at least gives a warning. |
cegganesh84
suggested changes
Sep 9, 2021
@@ -275,7 +275,10 @@ init-profile() { | |||
if [ -f $CBD_PROFILE ]; then | |||
debug "Use existing profile: $CBD_PROFILE" | |||
if [[ "$CBD_PROFILE" != *\/* ]]; then | |||
debug "$CBD_PROFILE file will be searched in your $PATH not just the current directory" | |||
PROFILES_ON_PATH="$(find $(echo $PATH | sed 's/:/ /g') -name 'Profile' -maxdepth 1 2>/dev/null | sort -u)" || true # for some reason I have to or true this |
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 have concerns about not quoting $PATH. If a directory in the path has space looks like it is treated as two separate directories. I am suspecting that is causing find to return 1 because of which you have to "or true" it?
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes CB-13978.