contrib/install-system-wide in rvm-1.1.1 vs contrib/install-system-wide in rvm-1.1.2
- old
+ new
@@ -42,10 +42,26 @@
echo "Creating the group '$1'"
case "$os_type" in
"FreeBSD") pw groupadd -q "$rvm_group_name";;
"Linux") groupadd -f "$rvm_group_name";;
+ "Darwin")
+ gid="501" #only gids > 500 show up in user preferences
+
+ #Find an open gid
+ while true; do
+ name=$(dscl . search /groups PrimaryGroupID $gid | cut -f1 -s)
+ if [ -z "$name" ] ; then
+ break
+ fi
+ gid=$[$gid +1]
+ done
+
+ #Create the group
+ dscl . -create "/Groups/$rvm_group_name"
+ dscl . -create "/Groups/$rvm_group_name" gid "$gid"
+ ;;
esac
fi
return 0
}
@@ -56,10 +72,11 @@
echo "Adding '$1' to the group '$2'"
case "$os_type" in
"FreeBSD") pw usermod "$1" -G "$2";;
"Linux") usermod -a -G "$2" "$1";;
+ "Darwin") dscl . -append "/Groups/$2" GroupMembership "$1";;
esac
return 0
}
@@ -73,11 +90,11 @@
# Check for the presence of git.
elif [[ -z "$(command -v git)" ]] ; then
echo "Please ensure git is installed and available in PATH to continue." >&2
exit 1
-elif [[ "$os_type" != "Linux" && "$os_type" != "FreeBSD" ]]; then
- echo "The rvm system wide installer currently only supports Linux and FreeBSD." >&2
+elif [[ "$os_type" != "Linux" && "$os_type" != "FreeBSD" && "$os_type" != "Darwin" ]]; then
+ echo "The rvm system wide installer currently only supports Linux, FreeBSD, and Darwin." >&2
exit 1
fi
while [[ $# -gt 0 ]] ; do
case $1 in