From 024a0607d799a9be8a9699a112b15e2c98cd8e11 Mon Sep 17 00:00:00 2001 From: Postmodern Date: Sat, 1 Feb 2025 23:33:15 -0800 Subject: [PATCH] Check the write permissions of `$install_dir` (closes #464,#326). --- bin/ruby-install | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/ruby-install b/bin/ruby-install index 17d7a3c3..ba6d7cd9 100755 --- a/bin/ruby-install +++ b/bin/ruby-install @@ -23,6 +23,10 @@ if [[ $no_reinstall -eq 1 ]] && [[ -x "$install_dir/bin/ruby" ]]; then exit fi +if ! check_write_permissions "$install_dir"; then + fail "Cannot write to the installation directory: $install_dir" +fi + log "Installing $ruby $ruby_version into $install_dir ..." pre_install || fail "Pre-install tasks failed!"