Honestpuck / homebrew.sh

Install homebrew via Jamf without giving users admin rights
Apache License 2.0
107 stars 30 forks source link

.profile created as root if it does not already exist #19

Open hoyle-ub opened 11 months ago

hoyle-ub commented 11 months ago

If a user does not already have a .profile when this script is run, the file is created with owner 'root', rather than the user who ran the script. There's probably a more elegant way to fix this, but I just added:

if [[ ! -f /Users/${consoleuser}/.profile ]]; then su -l "$consoleuser" -c "/usr/bin/touch /Users/${consoleuser}/.profile" fi

inside the if statement that sets the shellenv for M1 users.