Skip to content

Commit 2e78dce

Browse files
committed
Update build.sh
1 parent 7912ee5 commit 2e78dce

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

build.sh

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,24 @@ fi
88
set -e
99

1010
now() {
11-
date +%s.%N
11+
date -u +%s.%N
1212
}
1313

1414
duration_since() {
1515
duration_secs=$(echo "$(now) - $1" | bc)
1616

17-
days=$(echo "$duration_secs / 86400" | bc)
18-
remaining_secs=$(echo "$duration_secs - ($days * 86400)" | bc)
19-
20-
hours=$(echo "$remaining_secs / 3600" | bc)
21-
remaining_secs=$(echo "$remaining_secs - ($hours * 3600)" | bc)
17+
hours=$(echo "$duration_secs / 3600" | bc)
18+
remaining_secs=$(echo "$duration_secs - ($hours * 3600)" | bc)
2219

2320
mins=$(echo "$remaining_secs / 60" | bc)
2421
secs=$(echo "$remaining_secs - ($mins * 60)" | bc)
2522

26-
if [ "$((mins + hours + days))" -eq 0 ]; then
23+
if [ "$((mins + hours))" -eq 0 ]; then
2724
echo """$secs""s"
28-
elif [ "$((hours + days))" -eq 0 ]; then
25+
elif [ "$hours" -eq 0 ]; then
2926
echo """$mins""m ""$secs""s"
30-
elif [ "$days" -eq 0 ]; then
31-
echo """$hours""h ""$mins""m ""$secs""s"
3227
else
33-
echo """$days""d ""$hours""h ""$mins""m ""$secs""s"
28+
echo """$hours""h ""$mins""m ""$secs""s"
3429
fi
3530
}
3631

0 commit comments

Comments
 (0)