mirror of
https://github.com/troglobit/finit.git
synced 2026-10-02 05:52:48 +07:00
The script testenv_enter.sh, by default, runs /bin/sh in the environment currently setup. A bit easier than copy pasting the old hint text printed before test run. Signed-off-by: Magnus Malm <magnusmalm@gmail.com>
24 lines
339 B
Bash
Executable File
24 lines
339 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -eu
|
|
|
|
cmd=""
|
|
if [ "$#" -lt 1 ]; then
|
|
cmd="/bin/sh"
|
|
else
|
|
cmd=$1
|
|
shift
|
|
fi
|
|
|
|
PID_FILE=$(dirname "$0")/running_test.pid
|
|
|
|
if [ -f "$PID_FILE" ] ; then
|
|
target=$(cat "$PID_FILE")
|
|
target=$(pgrep -P "$target")
|
|
else
|
|
echo "No test running!"
|
|
exit 1
|
|
fi
|
|
|
|
"$(dirname "$0")"/testenv_exec.sh "$target" "$cmd" "$@"
|