Skip to content

Commit c7eb4cc

Browse files
Test Spinner / Progress Bar Function for Travis-CI Terminal
1 parent 1c010ef commit c7eb4cc

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

.dev-tools/install-apache-2.2.sh

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,33 @@ while kill -0 $!; do
6666
done
6767
}
6868

69+
spinner () {
70+
local pid=$!
71+
local delay=0.75
72+
local spinstr='|/-\'
73+
while [ "$(ps a | awk '{print $1}' | grep $pid)" ]; do
74+
local temp=${spinstr#?}
75+
printf " [%c] " "$spinstr"
76+
local spinstr=$temp${spinstr%"$temp"}
77+
sleep $delay
78+
printf "\b\b\b\b\b\b"
79+
done
80+
printf " \b\b\b\b"
81+
}
6982

7083
# **************************************
7184
# Make sure no other Apache is Installed
7285
# **************************************
7386

74-
sudo apt-get remove --purge apache2
87+
sudo apt-get remove --purge apache2 &
88+
spinner
7589

7690
# *************************************************************
7791
# Make sure We Have Build Essentials for Building apache 2.2.25
7892
# *************************************************************
7993

80-
sudo apt-get install build-essential
94+
sudo apt-get install build-essential &
95+
spinner
8196

8297
# ************************
8398
# Lets Build Apache 2.2.25

0 commit comments

Comments
 (0)