Skip to content

Commit 24fe444

Browse files
committed
script/setup/install-runc: Add trap statement to clean up tmp files
This PR adds the trap statement in the install runc script to clean up the temporary files and ensure we are not leaving them. Signed-off-by: Gabriela Cervantes <[email protected]>
1 parent 01ca26f commit 24fe444

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

script/setup/install-runc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ function install_runc() {
3434
: "${RUNC_REPO:=https://github.com/opencontainers/runc.git}"
3535

3636
TMPROOT=$(mktemp -d)
37+
trap "rm -fR ${TMPROOT}" EXIT
3738
git clone "${RUNC_REPO}" "${TMPROOT}"/runc
3839
pushd "${TMPROOT}"/runc
3940
git checkout "${RUNC_VERSION}"
4041
env -u VERSION make BUILDTAGS='seccomp' runc
4142
$SUDO make install
4243
popd
43-
rm -fR "${TMPROOT}"
4444
}
4545

4646
function install_crun() {

0 commit comments

Comments
 (0)