You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What happened?
Running source <(devspace completion bash) causes the error below:
bash: ommand not found...
bash: 36m[info]: command not found...
This happens when one of the parent folders of the current working directory contains a devspace.yaml file.
For me, this happens when I open a new tab or split a terminal in my terminal emulator while in a subfolder of a project that uses devspace.
What did you expect to happen instead?
Not printing [info] Using devspace config in ... when running devspace completion, and thus no error message.
How can we reproduce the bug? (as minimally and precisely as possible)
cd /tmp && mkdir test && cd test && touch devspace.yaml && mkdir subfolder && cd subfolder/ && devspace completion bash | head -n 1
You will see [info] Using devspace config in /tmp/test printed.
Instead, you should see something like # bash completion for devspace ...
I had a quick look at the code.
The info message in question gets printed by configLoader.SetDevSpaceRoot() that's called from cmd.getCommands() here - https://github.com/loft-sh/devspace/blob/a5eac169596719ace76d4824fb8e1b085581dc25/cmd/run.go#L206
I couldn't quickly come up with an elegant solution that would preserve all other functionality, so I'll probably leave this to folks more familiar with the code base. :)
loft-bot
changed the title
devspace completion prints info statement that results in command not found when executed/sourced
devspace completion prints info statement that results in command not found when executed/sourced
Sep 21, 2022
What happened?
Running
source <(devspace completion bash)
causes the error below:This happens when one of the parent folders of the current working directory contains a devspace.yaml file.
For me, this happens when I open a new tab or split a terminal in my terminal emulator while in a subfolder of a project that uses devspace.
What did you expect to happen instead?
Not printing
[info] Using devspace config in ...
when running devspace completion, and thus no error message.How can we reproduce the bug? (as minimally and precisely as possible)
You will see
[info] Using devspace config in /tmp/test
printed.Instead, you should see something like
# bash completion for devspace ...
Local Environment:
Workaround:
source <(devspace completion bash | grep -v -e "Using devspace config in")
/kind bug
The text was updated successfully, but these errors were encountered: