1
0
mirror of https://github.com/avatao-content/test-tutorial-framework synced 2024-11-15 01:37:17 +00:00
test-tutorial-framework/hack/libhack/common.sh

24 lines
362 B
Bash
Raw Normal View History

pushd() {
command pushd "$@" > /dev/null
}
popd() {
command popd "$@" > /dev/null
}
spinned() {
"$@" &
pid=$!
spin=("-" "\\" "|" "/")
echo -n "${spin[0]}"
while kill -0 $pid &> /dev/null; do
for i in "${spin[@]}"; do
echo -ne "\b$i"
sleep 0.1
done
done
echo -ne "\b"
wait $pid
}