Skip to content

Commit 523c4c6

Browse files
committed
Refactor of printf; refactor ezk kubectl
1 parent ec42345 commit 523c4c6

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

EasyKey.kubectl/ezk-kubectl-functions.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,3 +227,10 @@ editDeployment() {
227227
executeCommand "kubectl edit deployment $fname"
228228
}
229229

230+
kubeContext() {
231+
echo "Current context: $(kubectl config current-context)"
232+
echo "Namespace: $(kubectl config view --minify -o jsonpath='{..namespace}')"
233+
echo
234+
deplomentActualStatus
235+
}
236+

EasyKey.kubectl/kubectl.sh

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,11 @@
44
# EasyKey.kubectl utility main script #
55
#######################################
66

7-
kubeContext() {
8-
echo "Current context: $(kubectl config current-context)"
9-
echo "Namespace: $(kubectl config view --minify -o jsonpath='{..namespace}')"
10-
echo
11-
deplomentActualStatus
12-
}
13-
147
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
158
source "$script_dir/../shellmenu.sh"
169
source "$script_dir/ezk-kubectl-functions.sh"
1710

18-
menuInit "Super KUBECTL Home"
11+
menuInit "EasyKey.kubectl"
1912
submenuHead "Kubectl Config:" "Test:"
2013
menuItemClm a "Show config" "kubectl config view" b "Switch context" switchContext
2114
menuItemClm c "Switch namespace" switchNamespace d "Add cluster" addCluster

shellmenu.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -631,8 +631,8 @@ draw_rounded_square() {
631631
formattedTop=$(tput setaf $clrWhite)$(tput setab $clrBlue)$(tput bold)$border$(tput sgr0)
632632
formattedMiddle=$(tput setaf $clrWhite)$(tput setab $clrBlue)$(tput bold)"$vertical_line "$(tput setaf $clrWhite)$(tput setab $clrBlue)$(tput bold)$text$(tput sgr0)$(tput setaf $clrWhite)$(tput setab $clrBlue)$(tput bold)" $vertical_line"$(tput sgr0)
633633

634-
formattedheading+=$(printf '%s' "$formattedTop\n\r")
635-
formattedheading+=$(printf '%s' "$formattedMiddle\n\r")
634+
formattedheading+=$(printf '%s\n\r' "$formattedTop")
635+
formattedheading+=$(printf '%s\n\r' "$formattedMiddle")
636636

637637
border="$bottom_left_corner"
638638
for (( i=0; i<width+2; i++ )); do
@@ -641,7 +641,7 @@ draw_rounded_square() {
641641
border+="$bottom_right_corner"
642642

643643
formattedBottom=$(tput setaf $clrWhite)$(tput setab $clrBlue)$(tput bold)$border$(tput sgr0)
644-
formattedheading+=$(printf '%s' "$formattedBottom\n\r")
644+
formattedheading+=$(printf '%s\n\r' "$formattedBottom")
645645

646646
printf '%s' "$formattedheading"
647647

0 commit comments

Comments
 (0)