Skip to content
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

Fix profiles in bash command completion #96

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

loleary
Copy link

@loleary loleary commented Sep 11, 2018

The completion function used a hard coded reference to $HOME of the user
who originally executed the command. This meant that if the root user
executed oc-cluster completion bash the profiles variable would be
assigned to the base names in /root/.oc/profiles/.

This change utilizes the environment variable OPENSHIFT_HOME_DIR and
OPENSHIFT_PROFILES_DIR and if not set, assigns them in the same manner
that oc-cluster itself does. This allows the completion script to work
on a multi-user machine or when invoked by the root user for the purpose
of writing the output to /etc/bash_completion.d/oc-cluster.bash.

The completion function used a hard coded reference to $HOME of the user
who originally executed the command. This meant that if the root user
executed `oc-cluster completion bash` the profiles variable would be
assigned to the base names in `/root/.oc/profiles/`.

This change utilizes the environment variable OPENSHIFT_HOME_DIR and
OPENSHIFT_PROFILES_DIR and if not set, assigns them in the same manner
that oc-cluster itself does. This allows the completion script to work
on a multi-user machine or when invoked by the root user for the purpose
of writing the output to /etc/bash_completion.d/oc-cluster.bash.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant