Allow truffleruby to install in an existing empty directory
The check to prevent deleting user files during clean_prefix_path by disallowing installs into existing directories that weren't earlier truffleruby installs broke asdf installs, as asdf always creates an empty directory before installing. This fix adds a second exception to the existing directory case when that directory is empty. The check is done via testing the length of ls output. The logic was manually tested against non-existing directories, existing empty directories, existing non-empty directories in general, and existing non-empty directories that contained a file named "bin/truffleruby". I also copied the file over my existing asdf version of ruby-build and made sure that it successfully installed truffleruby.
parent
2004fd71
Please register or sign in to comment