Skip to content

Commit

Permalink
demo-sleep: more stable; support custom CARGO_TARGET_DIR
Browse files Browse the repository at this point in the history
  • Loading branch information
lpenz committed Jan 4, 2022
1 parent 62b3121 commit 7d8f80d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions demos/demo-sleep.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

CARGO_TARGET_DIR=${CARGO_TARGET_DIR-$PWD/target}
function typeogle {
cmd="ogle $1"
printf "$ "
Expand All @@ -12,12 +13,13 @@ function typeogle {
}

typeogle '-p 3 -c "date; sleep 3"'
ogle -p 3 -c 'date; sleep 3' &
pid_ogle="$!"
(
"$CARGO_TARGET_DIR/debug/ogle" -p 3 -c 'date; sleep 3' &
pidogle="$!"
trap 'kill $pidogle; wait $pidogle' EXIT

sleep 16.5

kill "$pid_ogle"
)

printf '^C\n$ '
sleep 1
Expand Down

0 comments on commit 7d8f80d

Please sign in to comment.