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
Copy file name to clipboardExpand all lines: kubectl-prompt
+12-11Lines changed: 12 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,7 @@ LBLUE=$(echo -en '\033[01;34m')
5
5
YELLOW=$(echo -en '\033[00;33m')
6
6
RESTORE=$(echo -en '\033[0m')
7
7
8
+
SHELL_PROFILE=$(. ./which-shell.sh)
8
9
9
10
COMMAND="${@}"
10
11
export COMMAND="$COMMAND"
@@ -54,23 +55,23 @@ function add_prompt() {
54
55
if [[ "$NAMESPACE" ]];then
55
56
read -p "${YELLOW}* Add the namespace ${NAMESPACE} to prompt list [y/n]? ${RESTORE}" answer
56
57
[[ "$answer"!="y" ]] &&exit 0
57
-
echo -e "\n${YELLOW}* Adding ${CLUSTER}${NAMESPACE} to \${KUBECTL_NAMESPACE_PROMPT} in ~/.bash_profile\n- The changes will be applied after starting a new terminal session or after running: source ~/.bash_profile${RESTORE}"
58
+
echo -e "\n${YELLOW}* Adding ${CLUSTER}${NAMESPACE} to \${KUBECTL_NAMESPACE_PROMPT} in ~/${SHELL_PROFILE}\n- The changes will be applied after starting a new terminal session or after running: source ~/${SHELL_PROFILE}${RESTORE}"
read -p "${YELLOW}* Add the cluster ${CLUSTER} to prompt list [y/n]? ${RESTORE}" answer
63
64
[[ "$answer"!="y" ]] &&exit 0
64
-
echo -e "\n${YELLOW}* Adding ${CLUSTER} to \${KUBECTL_CLUSTER_PROMPT} in ~/.bash_profile\n- The changes will be applied after starting a new terminal session or after running: source ~/.bash_profile${RESTORE}"
65
+
echo -e "\n${YELLOW}* Adding ${CLUSTER} to \${KUBECTL_CLUSTER_PROMPT} in ~/${SHELL_PROFILE}\n- The changes will be applied after starting a new terminal session or after running: source ~/${SHELL_PROFILE}${RESTORE}"
65
66
KUBECTL_CLUSTER_PROMPT+="${CLUSTER/%/ }"
66
-
ex '+g/KUBECTL_CLUSTER_PROMPT=/d' -cwq ~/.bash_profile
0 commit comments