Skip to content

Commit 2cf48cd

Browse files
committed
fix: use printf instead of echo for ANSI escape sequences
Replaced echo with printf for lines containing ANSI color codes to improve portability across different shells. Fixes Codacy warnings: - Line 44: echo → printf for color formatting - Line 45: echo → printf with proper format string - Line 51: echo → printf in loop with format placeholders The echo command's handling of escape sequences is not standardized across shells. printf is the portable solution and is recommended by POSIX for formatted output.
1 parent 56e49d5 commit 2cf48cd

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

dockerfiles/codespacesURL.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,20 @@ done
3737
message=${message%??}
3838

3939
# Display information to user
40-
echo ""
41-
echo "🚀 Jenkins Quickstart Tutorials Setup"
42-
echo "======================================"
43-
echo ""
44-
echo "Once you run \033[42;30mdocker compose --profile <profile-name> up\033[0m,"
45-
echo "Jenkins will be accessible at: \033[36m${service_url}\033[0m"
46-
echo ""
47-
echo -e "${message}"
48-
echo ""
49-
echo "Quick start commands:"
40+
printf "\n"
41+
printf "🚀 Jenkins Quickstart Tutorials Setup\n"
42+
printf "======================================\n"
43+
printf "\n"
44+
printf "Once you run \033[42;30mdocker compose --profile <profile-name> up\033[0m,\n"
45+
printf "Jenkins will be accessible at: \033[36m%s\033[0m\n" "${service_url}"
46+
printf "\n"
47+
printf "%b\n" "${message}"
48+
printf "\n"
49+
printf "Quick start commands:\n"
5050
for target in "${targets[@]}"; do
51-
echo " • \033[42;30mdocker compose --profile ${target} up -d\033[0m - Start ${target} tutorial"
51+
printf " • \033[42;30mdocker compose --profile %s up -d\033[0m - Start %s tutorial\n" "${target}" "${target}"
5252
done
53-
echo ""
53+
printf "\n"
5454

5555
# Check if jenkins.yaml exists
5656
if [ ! -f "${config_file}" ]; then

0 commit comments

Comments
 (0)