From 87dc2099c84b073671ccb90a4c389704794d18b3 Mon Sep 17 00:00:00 2001 From: Eric Ribeiro Date: Mon, 22 Aug 2022 17:34:08 -0300 Subject: [PATCH] feat: clean-up after `install-docker-compose` (#148) --- src/scripts/install-docker-compose.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/scripts/install-docker-compose.sh b/src/scripts/install-docker-compose.sh index 6944ec7..0ea9893 100644 --- a/src/scripts/install-docker-compose.sh +++ b/src/scripts/install-docker-compose.sh @@ -1,5 +1,12 @@ #!/usr/bin/env bash +trap_exit() { + # clean-up + printf '%s\n' "Cleaning up..." + [ -f "$DOCKER_SHASUM_FILENAME" ] && rm -f "$DOCKER_SHASUM_FILENAME" +} +trap trap_exit EXIT + # checking for root user if [[ $(id -u) -eq 0 ]]; then SUDO="" @@ -83,4 +90,4 @@ $SUDO mv "$DOCKER_COMPOSE_RELEASE" "$PARAM_INSTALL_DIR"/docker-compose $SUDO chmod +x "$PARAM_INSTALL_DIR"/docker-compose # verify version -echo "$(docker-compose --version) has been installed to $(command -v docker-compose)" \ No newline at end of file +echo "$(docker-compose --version) has been installed to $(command -v docker-compose)"