Skip to content

Commit

Permalink
Reintroduce cleanup of trampoline files after we've used them.
Browse files Browse the repository at this point in the history
  • Loading branch information
technomancy committed Oct 27, 2017
1 parent 4c7f037 commit 91afe60
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 12 deletions.
15 changes: 11 additions & 4 deletions bin/lein
Original file line number Diff line number Diff line change
Expand Up @@ -364,11 +364,18 @@ else
stty icanon echo > /dev/null 2>&1
fi

TRAMPOLINE="$(cat "$TRAMPOLINE_FILE")"
if [ "$TRAMPOLINE" = "" ]; then
exit $EXIT_CODE
if [ -r "$TRAMPOLINE_FILE" ] && [ "$LEIN_TRAMPOLINE_WARMUP" = "" ]; then
TRAMPOLINE="$(cat "$TRAMPOLINE_FILE")"
if [ "$INPUT_CHECKSUM" = "" ]; then # not using fast trampoline
rm "$TRAMPOLINE_FILE"
fi
if [ "$TRAMPOLINE" = "" ]; then
exit $EXIT_CODE
else
exec sh -c "exec $TRAMPOLINE"
fi
else
exec sh -c "exec $TRAMPOLINE"
exit $EXIT_CODE
fi
fi
fi
15 changes: 11 additions & 4 deletions bin/lein-pkg
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,17 @@ else

EXIT_CODE=$?

TRAMPOLINE="$(cat "$TRAMPOLINE_FILE")"
if [ "$TRAMPOLINE" = "" ]; then
exit $EXIT_CODE
if [ -r "$TRAMPOLINE_FILE" ] && [ "$LEIN_TRAMPOLINE_WARMUP" = "" ]; then
TRAMPOLINE="$(cat "$TRAMPOLINE_FILE")"
if [ "$INPUT_CHECKSUM" = "" ]; then # not using fast trampoline
rm "$TRAMPOLINE_FILE"
fi
if [ "$TRAMPOLINE" = "" ]; then
exit $EXIT_CODE
else
exec sh -c "exec $TRAMPOLINE"
fi
else
exec sh -c "exec $TRAMPOLINE"
exit $EXIT_CODE
fi
fi
15 changes: 11 additions & 4 deletions bin/lein-sdkman
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,17 @@ else
stty icanon echo > /dev/null 2>&1
fi

TRAMPOLINE="$(cat "$TRAMPOLINE_FILE")"
if [ "$TRAMPOLINE" = "" ]; then
exit $EXIT_CODE
if [ -r "$TRAMPOLINE_FILE" ] && [ "$LEIN_TRAMPOLINE_WARMUP" = "" ]; then
TRAMPOLINE="$(cat "$TRAMPOLINE_FILE")"
if [ "$INPUT_CHECKSUM" = "" ]; then # not using fast trampoline
rm "$TRAMPOLINE_FILE"
fi
if [ "$TRAMPOLINE" = "" ]; then
exit $EXIT_CODE
else
exec sh -c "exec $TRAMPOLINE"
fi
else
exec sh -c "exec $TRAMPOLINE"
exit $EXIT_CODE
fi
fi

0 comments on commit 91afe60

Please sign in to comment.