Skip to content

Commit

Permalink
run: cleanup background jobs on exit
Browse files Browse the repository at this point in the history
  • Loading branch information
georgyo authored and ignoramous committed Jul 30, 2022
1 parent f6ad1bf commit d736751
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions run
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ banner() {
echo " ";
}

cleanup() {
kill $(jobs -p)
}
trap cleanup EXIT

bgcmd() {
$1 &
}
Expand Down

0 comments on commit d736751

Please sign in to comment.