Skip to content

Commit

Permalink
Only clean up temp files created by bitbucket_request
Browse files Browse the repository at this point in the history
Hide output of pgrep and killall so they don't interfere with the
response.
  • Loading branch information
mmb committed May 12, 2020
1 parent ad45c83 commit d283701
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions assets/helpers/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,10 @@ getBasePathOfBitbucket() {
}

cleanup() {
rm -rf "$TMPDIR/bitbucket-pullrequest-resource-*"
if pgrep ssh-agent; then
killall ssh-agent
rm -rf "$TMPDIR/bitbucket-pullrequest-resource-bitbucket-request*"
rm -rf "$TMPDIR/bitbucket-pullrequest-resource-bitbucket-request-data*"
if pgrep ssh-agent > /dev/null 2>&1; then
killall ssh-agent > /dev/null 2>&1
fi
}

Expand Down

0 comments on commit d283701

Please sign in to comment.