Packages
wallabidi
0.2.14
0.4.4
0.4.3
0.4.2
0.4.1
0.4.0
0.4.0-rc.11
0.4.0-rc.10
0.4.0-rc.9
0.4.0-rc.8
0.4.0-rc.7
0.4.0-rc.6
0.4.0-rc.5
0.4.0-rc.4
0.4.0-rc.3
0.4.0-rc.2
0.4.0-rc.1
0.4.0-rc.0
0.2.14
0.2.13
0.2.12
0.2.11
0.2.9
0.2.8
0.2.7
0.2.6
0.2.5
0.2.4
0.2.3
0.2.2
0.2.1
0.2.0
0.1.42
0.1.41
0.1.39
0.1.38
0.1.37
0.1.36
0.1.35
0.1.34
0.1.33
0.1.31
0.1.30
0.1.29
0.1.28
0.1.27
0.1.26
0.1.25
0.1.24
0.1.23
0.1.22
0.1.21
0.1.20
0.1.19
0.1.17
0.1.16
0.1.14
0.1.13
0.1.12
0.1.11
0.1.9
0.1.8
0.1.7
0.1.6
0.1.5
0.1.4
0.1.2
0.1.1
0.1.0
Concurrent browser testing and scraping for Elixir, powered by WebDriver BiDi. A fork of Wallaby.
Current section
Files
Jump to
Current section
Files
priv/run_command.sh
#!/usr/bin/env bash
script_status="running"
# Start the program in the background
exec "$@" &
pid1=$!
echo "PID: $pid1"
shutdown(){
local pid1=$1
local pid2=$1
if [ $script_status = "running" ]; then
script_status="shutting down"
wait $pid1
ret=$?
kill -KILL $pid2
exit $ret
fi
}
# Silence warnings from here on
exec >/dev/null 2>&1
# Read from stdin in the background and
# kill running program when stdin closes
exec 0<&0 "$(
while read -r; do :; done
kill -KILL $pid1
)" &
pid2=$!
# Clean up
trap 'shutdown $pid1 $pid2' INT HUP TERM
shutdown $pid1 $pid2