Skip to content

Commit

Permalink
Fix groups
Browse files Browse the repository at this point in the history
  • Loading branch information
rbamos committed Jul 9, 2024
1 parent 98041bb commit f88940f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,14 @@ fi
# This may optionally install the Xcode CLT if it is not already installed.
if ! which brew > /dev/null ; then
# If using Linux, create /home/<user>/ using sudo permission
#if the home directory does not exist
if [[ "$kernel_name" == "Linux" ]] && [[ ! -e "/home/$(whoami)" ]]; then
sudo mkdir -p "/home/$(whoami)"
sudo chown -R "$(whoami):$(whoami)" "/home/$(whoami)"
if id -gn | grep 'users' > /dev/null; then
group='users'
else
group=$(id -gn | cut -d ' ' -f 1)
fi
sudo chown -R "$(whoami):$group" "/home/$(whoami)"
fi

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Expand Down

0 comments on commit f88940f

Please sign in to comment.