Delete temp directory in get-daml.sh (#3233)

* Delete temp directory after get-daml.sh

* Revert dockerfile change from #3224
This commit is contained in:
associahedron 2019-10-18 17:02:02 +01:00 committed by GitHub
parent f3b98ca31d
commit b7e6088bcd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 7 deletions

View File

@ -3,5 +3,5 @@ RUN apk add curl bash
ARG VERSION
RUN addgroup -S daml && adduser -S daml -G daml
USER daml
RUN curl https://get.daml.com | sh -s $VERSION && rm -rf /tmp/*
RUN curl https://get.daml.com | sh -s $VERSION
ENV PATH="/home/daml/.daml/bin:${PATH}"

View File

@ -17,14 +17,17 @@
#
set -eu
cleanup() {
echo "$(tput setaf 3)FAILED TO INSTALL!$(tput sgr 0)"
}
trap cleanup EXIT
readonly SWD="$PWD"
readonly TMPDIR="$(mktemp -d)"
cd $TMPDIR
cleanup() {
echo "$(tput setaf 3)FAILED TO INSTALL!$(tput sgr 0)"
cd $SWD
rm -rf $TMPDIR
}
trap cleanup EXIT
#
# Check if curl and tar are available.
#
@ -113,4 +116,5 @@ fi
#
trap - EXIT
echo "$(tput setaf 3)Successfully installed DAML.$(tput sgr 0)"
cd $SWD
rm -rf $TMPDIR