Skip to content

Commit 10deeb1

Browse files
committed
Add colour to dashboard delete.
1 parent 64ffa31 commit 10deeb1

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

scripts/list_workspace_resource.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -799,19 +799,20 @@ function _list_cloudwatch_dashboards() {
799799
function _delete_cloudwatch_dashboards() {
800800
local workspace=$1
801801
if [ -z "$workspace" ]; then
802-
echo "Error: Workspace substring must be provided. Refusing to delete all dashboards."
802+
echo -e "${RED}Error: Workspace substring must be provided. Refusing to delete all dashboards.${NC}"
803803
return 1
804804
fi
805805

806806
local dashboards=$(aws cloudwatch list-dashboards --output json)
807807
dashboards=$(echo "$dashboards" | jq -r --arg SUBSTRING "$workspace" '.DashboardEntries[] | select(.DashboardName | contains($SUBSTRING)) | .DashboardName')
808808

809-
[ -z "$dashboards" ] && echo "No CloudWatch Dashboards found for deletion." && return 0
809+
[ -z "$dashboards" ] && echo -e "${RED}No CloudWatch Dashboards found for deletion.${NC}" && return 0
810810

811-
echo "Deleting the following CloudWatch Dashboards:"
811+
echo -e "${GREEN}Deleting the following CloudWatch Dashboards:"
812812
for dashboard in $dashboards; do
813-
echo "$dashboard"
813+
echo -e "$dashboard"
814814
done
815+
echo -e " ${NC}"
815816
aws cloudwatch delete-dashboards --dashboard-names $dashboards
816817
}
817818

0 commit comments

Comments
 (0)