Skip to content

Commit

Permalink
Change time output to include dots in the end. (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
ming13 authored Feb 22, 2017
1 parent 153373a commit 11281e8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions mainframer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function formatTime {

(( hours > 0 )) && printf "%d $HOURS_LABEL " ${hours}
(( minutes > 0 )) && printf "%d $MINUTES_LABEL " ${minutes}
(( seconds >= 0 )) && printf "%d $SECONDS_LABEL \n" ${seconds}
(( seconds >= 0 )) && printf "%d $SECONDS_LABEL" ${seconds}
}

function syncBeforeRemoteCommand {
Expand All @@ -105,7 +105,7 @@ function syncBeforeRemoteCommand {
eval "$COMMAND"

endTime="$(date +%s)"
echo "Sync done: took $(formatTime $((endTime-startTime)))"
echo "Sync done: took $(formatTime $((endTime-startTime)))."
echo ""
}

Expand All @@ -126,9 +126,9 @@ function executeRemoteCommand {
duration="$((endTime-startTime))"

if [ "$REMOTE_COMMAND_SUCCESSFUL" == "true" ]; then
echo "Execution done: took $(formatTime $duration)"
echo "Execution done: took $(formatTime $duration)."
else
echo "Execution failed: took $(formatTime $duration)"
echo "Execution failed: took $(formatTime $duration)."
fi

echo ""
Expand All @@ -152,7 +152,7 @@ function syncAfterRemoteCommand {
eval "$COMMAND"

endTime="$(date +%s)"
echo "Sync done: took $(formatTime $((endTime-startTime)))"
echo "Sync done: took $(formatTime $((endTime-startTime)))."
}

pushd "$PROJECT_DIR" > /dev/null
Expand All @@ -169,8 +169,8 @@ echo ""
DURATION="$((FINISH_TIME-START_TIME))"

if [ "$REMOTE_COMMAND_SUCCESSFUL" == "true" ]; then
echo "Success: took $(formatTime $DURATION)"
echo "Success: took $(formatTime $DURATION)."
else
echo "Failure: took $(formatTime $DURATION)"
echo "Failure: took $(formatTime $DURATION)."
exit 1
fi

0 comments on commit 11281e8

Please sign in to comment.