Skip to content

Commit bf564dd

Browse files
committed
warn user that installation will fail if she doesn't have necessary write permission
1 parent 61a627e commit bf564dd

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

share/ruby-install/functions.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,22 @@ source "$ruby_install_dir/checksums.sh"
77
#
88
function pre_install()
99
{
10+
11+
local status
12+
local exisiting_part_dir="${install_dir%/*}"
13+
1014
mkdir -p "$src_dir" || return $?
11-
mkdir -p "${install_dir%/*}" || return $?
15+
16+
while [ ! -d "$exisiting_part_dir" ]; do
17+
exisiting_part_dir="${exisiting_part_dir%/*}"
18+
done
19+
20+
if [ ! -w "$exisiting_part_dir" ]; then
21+
fail "Installation directory : ${exisiting_part_dir} is not writable by the user: $USER"
22+
status=$?
23+
fi
24+
25+
mkdir -p "${install_dir%/*}" || return $status
1226
}
1327

1428
#

0 commit comments

Comments
 (0)