Skip to content

Commit

Permalink
Merge pull request #47 from flavono123/feature/prompt/add-command-run
Browse files Browse the repository at this point in the history
prompt: Add `run' to tigger commands
  • Loading branch information
jordanwilson230 committed Nov 9, 2022
2 parents 6f5525f + 240b2e7 commit 03da9a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kubectl-prompt
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ ${YELLOW}Command: ${COMMAND}\n${RESTORE}"
# Skip checks if user has not assigned any (using kubectl prompt add [-n namespace OR -c cluster]
if [[ ! -z "$KUBECTL_NAMESPACE_PROMPT" ]] || [[ ! -z "$KUBECTL_CLUSTER_PROMPT" ]]; then
# Only prompt when the command would cause the state of the env to change.
echo "$@" | grep "deploy\|create\|apply\|set \|delete\|scale " 1>/dev/null
echo "$@" | grep "deploy\|create\|apply\|set \|delete\|scale \|run" 1>/dev/null
if [ $? -eq 0 ]; then
NAMESPACE=$(kubectl config view --template='{{ range .contexts }}{{ if eq .name "'$(kubectl config current-context)'" }}{{ .context.namespace }}{{ end }}{{ end }}')
CLUSTER=$(kubectl config view --template='{{ range .contexts }}{{ if eq .name "'$(kubectl config current-context)'" }}{{ .context.cluster }}{{ end }}{{ end }}')
Expand Down

0 comments on commit 03da9a9

Please sign in to comment.