Skip to content

Commit

Permalink
trap magic
Browse files Browse the repository at this point in the history
  • Loading branch information
bmw committed Mar 3, 2016
1 parent bd04076 commit 34eb86b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions letsencrypt-auto-source/letsencrypt-auto
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,6 @@ InstallRequirements() {
echo "Had a problem while downloading and verifying Python packages:"
echo "$PEEP_OUT"
rm -rf "$VENV_PATH"
rm -rf "$TEMP_DIR"
exit 1
fi
}
Expand All @@ -458,6 +457,7 @@ if [ "$1" = "--le-auto-phase2" ]; then

echo "Installing Python packages..."
TEMP_DIR=$(TempDir)
trap "rm -rf $TEMP_DIR" EXIT
# There is no $ interpolation due to quotes on starting heredoc delimiter.
# -------------------------------------------------------------------------
cat << "UNLIKELY_EOF" > "$TEMP_DIR/setuptools-requirements.txt"
Expand Down Expand Up @@ -1666,7 +1666,6 @@ UNLIKELY_EOF
# -------------------------------------------------------------------------
InstallRequirements "setuptools-requirements.txt"
InstallRequirements "letsencrypt-auto-requirements.txt"
rm -rf "$TEMP_DIR"
echo "Installation succeeded."
fi
echo "Requesting root privileges to run letsencrypt..."
Expand Down
3 changes: 1 addition & 2 deletions letsencrypt-auto-source/letsencrypt-auto.template
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ InstallRequirements() {
echo "Had a problem while downloading and verifying Python packages:"
echo "$PEEP_OUT"
rm -rf "$VENV_PATH"
rm -rf "$TEMP_DIR"
exit 1
fi
}
Expand All @@ -206,6 +205,7 @@ if [ "$1" = "--le-auto-phase2" ]; then

echo "Installing Python packages..."
TEMP_DIR=$(TempDir)
trap "rm -rf $TEMP_DIR" EXIT
# There is no $ interpolation due to quotes on starting heredoc delimiter.
# -------------------------------------------------------------------------
cat << "UNLIKELY_EOF" > "$TEMP_DIR/setuptools-requirements.txt"
Expand All @@ -222,7 +222,6 @@ UNLIKELY_EOF
# -------------------------------------------------------------------------
InstallRequirements "setuptools-requirements.txt"
InstallRequirements "letsencrypt-auto-requirements.txt"
rm -rf "$TEMP_DIR"
echo "Installation succeeded."
fi
echo "Requesting root privileges to run letsencrypt..."
Expand Down

0 comments on commit 34eb86b

Please sign in to comment.