Skip to content

Commit

Permalink
Add home directory if not exists
Browse files Browse the repository at this point in the history
  • Loading branch information
rbamos committed Jul 9, 2024
1 parent a8f01dc commit 98041bb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ 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 [[ "$kernel_name" == "Linux" ]]; then
sudo mkdir -p /home/$(whoami)
sudo chown -R $(whoami):$(whoami) /home/$(whoami)
#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)"
fi

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

0 comments on commit 98041bb

Please sign in to comment.