Skip to content

Commit 5f572fe

Browse files
committed
Fix echo colors
1 parent 79c09e8 commit 5f572fe

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

install_tool.sh

+9-4
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@ branch=${1:-"main"}
99
scripts_repo="https://raw.githubusercontent.com/codepath/cyb102-vm-setup/${branch}/Scripts/"
1010

1111
# Welcome message
12-
echo "Welcome to ${green}CodePath Cybersecurity${none}!"
13-
echo "This tool will help you set up your environment for the ${course} course."
12+
echo -e "Welcome to ${green}CodePath Cybersecurity${none}!"
13+
echo -e "This tool will help you set up your environment for the ${course} course."
14+
15+
if ! branch="main"; then
16+
echo -e "${yellow}WARNING: You are using the a non-default branch {$branch}.${none}"
17+
echo -e "${yellow}This is intended for development purposes only.${none}"
18+
fi
1419

1520
# Check if user is running Ubuntu
1621
if [ -f /etc/os-release ]; then
@@ -49,7 +54,7 @@ fi
4954

5055
# Function to install all scripts
5156
install_all_scripts() {
52-
echo "Installing all ${course} scripts..."
57+
echo -e "Installing all ${course} scripts..."
5358
for i in {1..8} ; do
5459
install_specific_unit "$i"
5560
done
@@ -93,7 +98,7 @@ install_specific_script() {
9398
# Check the exit status of the script
9499
status=$?
95100
if [ $status -ne 0 ] ; then
96-
echo "${red}Error:${none} ${script_name} exited with status $status"
101+
echo -e "${red}Error:${none} ${script_name} exited with status $status"
97102
read -p "Do you want to continue anyway? (y/n) " -n 1 -r
98103
echo
99104
if [[ ! $REPLY =~ ^[Yy]$ ]]; then

0 commit comments

Comments
 (0)