mirror of
https://github.com/mtan93/Installomator.git
synced 2026-03-28 13:23:06 +00:00
Update functions.sh
This commit is contained in:
@@ -378,25 +378,26 @@ installAppWithPath() { # $1: path to app to install in $targetDir
|
|||||||
|
|
||||||
# Test if variable CLIInstaller is set
|
# Test if variable CLIInstaller is set
|
||||||
if [[ -z $CLIInstaller ]]; then
|
if [[ -z $CLIInstaller ]]; then
|
||||||
# remove existing application
|
|
||||||
if [ -e "$targetDir/$appName" ]; then
|
# remove existing application
|
||||||
printlog "Removing existing $targetDir/$appName"
|
if [ -e "$targetDir/$appName" ]; then
|
||||||
rm -Rf "$targetDir/$appName"
|
printlog "Removing existing $targetDir/$appName"
|
||||||
fi
|
rm -Rf "$targetDir/$appName"
|
||||||
|
fi
|
||||||
|
|
||||||
# copy app to /Applications
|
# copy app to /Applications
|
||||||
printlog "Copy $appPath to $targetDir"
|
printlog "Copy $appPath to $targetDir"
|
||||||
if ! ditto "$appPath" "$targetDir/$appName"; then
|
if ! ditto "$appPath" "$targetDir/$appName"; then
|
||||||
cleanupAndExit 7 "Error while copying"
|
cleanupAndExit 7 "Error while copying"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# set ownership to current user
|
# set ownership to current user
|
||||||
if [ "$currentUser" != "loginwindow" ]; then
|
if [ "$currentUser" != "loginwindow" ]; then
|
||||||
printlog "Changing owner to $currentUser"
|
printlog "Changing owner to $currentUser"
|
||||||
chown -R "$currentUser" "$targetDir/$appName"
|
chown -R "$currentUser" "$targetDir/$appName"
|
||||||
else
|
else
|
||||||
printlog "No user logged in, not changing user"
|
printlog "No user logged in, not changing user"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
elif [[ ! -z $CLIInstaller ]]; then
|
elif [[ ! -z $CLIInstaller ]]; then
|
||||||
mountname=$(dirname $appPath)
|
mountname=$(dirname $appPath)
|
||||||
|
|||||||
Reference in New Issue
Block a user