From 4fac6eb011e1a88860cae721c7443c642c6be310 Mon Sep 17 00:00:00 2001 From: Koichi Nakashima Date: Sat, 20 Jul 2019 23:05:37 +0900 Subject: [PATCH] fix --- libexec/shellspec-profiler.sh | 2 +- libexec/shellspec-runner.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libexec/shellspec-profiler.sh b/libexec/shellspec-profiler.sh index a24c0fde..fa08c924 100755 --- a/libexec/shellspec-profiler.sh +++ b/libexec/shellspec-profiler.sh @@ -4,7 +4,7 @@ set -eu handler() { - eval "counter${index}=$counter && index=$(($index + 1))" + eval "counter${index}=$counter index=$(($index + 1)) cmd=:" } terminate() { diff --git a/libexec/shellspec-runner.sh b/libexec/shellspec-runner.sh index 2dd06d9d..5e5bbed5 100755 --- a/libexec/shellspec-runner.sh +++ b/libexec/shellspec-runner.sh @@ -19,9 +19,9 @@ start_profiler() { stop_profiler() { [ "$SHELLSPEC_PROFILER_PID" ] || return 0 - signal -TERM "$SHELLSPEC_PROFILER_PID" 2>/dev/null ||: + profiler_pid=$SHELLSPEC_PROFILER_PID && SHELLSPEC_PROFILER_PID='' + signal -TERM "$profiler_pid" 2>/dev/null ||: sleep_wait [ ! -e "$SHELLSPEC_TMPBASE/profiler.done" ] ||: - SHELLSPEC_PROFILER_PID='' } cleanup() {