From 15ce7bf729e39b8589fa403a896fd5bc074918c4 Mon Sep 17 00:00:00 2001 From: David P Date: Tue, 29 May 2018 14:53:23 -0400 Subject: run.sh: add fancy load() function Signed-off-by: David P --- run.sh | 46 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/run.sh b/run.sh index 5f407de..c2007c2 100755 --- a/run.sh +++ b/run.sh @@ -56,16 +56,54 @@ check() { deblob() { local configs=$(grep -v ^# $path/versions/$version) - for c in $configs; do - sed -i "s|$c=|# $c is not set|" $1 + local i + for i in $configs; do + sed -i "s|$i=|# $i is not set|" $1 + sleep 0.2 done } +load(){ +local num=${#1} +local i +for i in $(seq $num); do + space+=" " +done + +while true +do + printf "%s \r" "$space" + printf "[ running ] $1\r" + sleep 0.2 + printf "[ running ] $1 .\r" + sleep 0.2 + printf "[ running ] $1 ..\r" + sleep 0.2 + printf "[ running ] $1 ...\r" + sleep 0.2 + printf "[ running ] $1 ....\r" + sleep 0.2 + printf "[ running ] $1 .....\r" + sleep 0.2 +done +} + main(){ check + local i for i in $@; do - echo "Modifying $i" - deblob $i + load "Modifying $i" & + LOG=$(mktemp) + deblob $i &> $LOG + case $? in + 0) printf "[ OK ] \n" ;; + *) printf "[ FAILED ] \n" + err "Could not modify $i:" + cat $LOG; false ;; + esac + kill $! + wait $! 2>/dev/null || true + rm $LOG done } -- cgit v1.2.2