Skip to content

Commit 852778e

Browse files
committed
Add a -k/--keep option to ruby-build to keep the build path around after builds
1 parent f6c2bfe commit 852778e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

bin/ruby-build

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,15 @@ if [ -z "$PREFIX_PATH" ]; then
396396
usage
397397
fi
398398

399+
OPTIONS="$3"
400+
for option in $OPTIONS; do
401+
case "$option" in
402+
"-k" | "--keep" )
403+
KEEP_BUILD_PATH="y"
404+
;;
405+
esac
406+
done
407+
399408
if [ -z "$TMPDIR" ]; then
400409
TMP="/tmp"
401410
else
@@ -428,5 +437,5 @@ unset RUBYLIB
428437
trap build_failed ERR
429438
mkdir -p "$BUILD_PATH"
430439
source "$DEFINITION_PATH"
431-
rm -fr "$BUILD_PATH"
440+
[ -z "${KEEP_BUILD_PATH}" ] && rm -fr "$BUILD_PATH"
432441
trap - ERR

0 commit comments

Comments
 (0)