Skip to content

Commit

Permalink
optimize bosh deployments display for log-bosh/switch commands
Browse files Browse the repository at this point in the history
  • Loading branch information
ogrand committed Jun 11, 2024
1 parent 0b1c478 commit 51cef1b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tools/log-bosh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ if [ ${flagError} = 0 ] ; then
#--- Display selected bosh deployment status
if [ ${flagError} = 0 ] ; then
if [ ${flag_interactive} = 1 ] ; then
deployments=$(bosh deployments --column=Name | grep -vE "^Name$|^Succeeded$|^[0-9]* deployments$")
deployments="$(bosh deployments --json | jq -r '.Tables[].Rows[].name' | pr -3t -W 130)"
printf "\n%bSelect a specific deployment in the list, or suffix your bosh commands with -d <deployment_name>:%b\n%s" "${REVERSE}${GREEN}" "${STD}" "${deployments}"
printf "\n\n%bYour choice (<Enter> to select all) :%b " "${GREEN}${BOLD}" "${STD}" ; read BOSH_DEPLOYMENT

Expand Down
2 changes: 1 addition & 1 deletion tools/switch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if [ $? != 0 ] ; then
printf "\n\n%bERROR : You are not connected to bosh director.%b\n\n" "${RED}" "${STD}"
else
#--- Select specific deployment (BOSH_DEPLOYMENT variable)
deployments=$(bosh deployments --column=Name | grep -vE "^Name$|^Succeeded$|^[0-9]* deployments$")
deployments="$(bosh deployments --json | jq -r '.Tables[].Rows[].name' | pr -3t -W 130)"
if [ "$1" != "" ] ; then
flag=$(echo "${deployments}" | grep "$1")
if [ "${flag}" = "" ] ; then
Expand Down

0 comments on commit 51cef1b

Please sign in to comment.