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)"