-
-
Notifications
You must be signed in to change notification settings - Fork 660
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug with bash autocompletion for the users who has
.
in their P…
…ATH environment variable (#868)
- Loading branch information
Showing
4 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fix bug with bash autocompletion for the users who has `.` in their PATH environment variable |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
# Navigate to app with minimal configuration | ||
cd tests/test_apps/app_with_cfg/ | ||
|
||
# Locate python | ||
PYTHON=$(command -v python) | ||
|
||
# Setup hydra bash completion | ||
eval "$(python my_app.py -sc install=bash)" | ||
|
||
# Setup debugging | ||
export HYDRA_COMP_DEBUG=1 | ||
export PATH=$PATH:. | ||
|
||
# Do actual test | ||
test=$(COMP_LINE='python my_app.py' hydra_bash_completion |\ | ||
grep EXECUTABLE_FIRST |\ | ||
awk '{split($0,a,"=");b=substr(a[2],2,length(a[2])-2);print b}') | ||
|
||
if [ $test == $PYTHON ]; then | ||
echo TRUE | ||
else | ||
echo FALSE | ||
fi |
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