Run dotnet new command as current user in installer
If not, the dotnet new will run as root and the cache folders will be in root ownership How to get current user https://apple.stackexchange.com/questions/144159/how-can-i-determine-the-invoking-user-in-an-apple-installer-postinstall-script
This commit is contained in:
parent
52e3ad7f9a
commit
9f8ab82a6c
1 changed files with 3 additions and 2 deletions
|
@ -11,7 +11,8 @@ INSTALL_DESTINATION=$2
|
|||
# A temporary fix for the permissions issue(s)
|
||||
chmod -R 755 $INSTALL_DESTINATION
|
||||
|
||||
# Run 'dotnet new' to trigger the first time experience to initialize the cache
|
||||
$INSTALL_DESTINATION/dotnet new > /dev/null 2>&1 || true
|
||||
# Run 'dotnet new' as user to trigger the first time experience to initialize the cache
|
||||
INSTALLER_USER=$(stat -f '%Su' $HOME)
|
||||
su - $INSTALLER_USER -c "$INSTALL_DESTINATION/dotnet new > /dev/null 2>&1 || true"
|
||||
|
||||
exit 0
|
||||
|
|
Loading…
Reference in a new issue