mirror of
https://github.com/mtan93/Installomator.git
synced 2026-03-19 13:20:52 +00:00
Improved logging for app copy with ditto
And a few lines changed to `WARN`.
This commit is contained in:
@@ -486,7 +486,7 @@ installAppWithPath() { # $1: path to app to install in $targetDir
|
|||||||
|
|
||||||
# remove existing application
|
# remove existing application
|
||||||
if [ -e "$targetDir/$appName" ]; then
|
if [ -e "$targetDir/$appName" ]; then
|
||||||
printlog "Removing existing $targetDir/$appName" DEBUG
|
printlog "Removing existing $targetDir/$appName" WARN
|
||||||
deleteAppOut=$(rm -Rfv "$targetDir/$appName" 2>&1)
|
deleteAppOut=$(rm -Rfv "$targetDir/$appName" 2>&1)
|
||||||
tempName="$targetDir/$appName"
|
tempName="$targetDir/$appName"
|
||||||
tempNameLength=$((${#tempName} + 10))
|
tempNameLength=$((${#tempName} + 10))
|
||||||
@@ -497,16 +497,21 @@ installAppWithPath() { # $1: path to app to install in $targetDir
|
|||||||
|
|
||||||
# copy app to /Applications
|
# copy app to /Applications
|
||||||
printlog "Copy $appPath to $targetDir"
|
printlog "Copy $appPath to $targetDir"
|
||||||
if ! ditto "$appPath" "$targetDir/$appName"; then
|
copyAppOut=$(ditto -v "$appPath" "$targetDir/$appName" 2>&1)
|
||||||
cleanupAndExit 7 "Error while copying" ERROR
|
copyAppStatus=$(echo $?)
|
||||||
|
deduplicatelogs "$copyAppOut"
|
||||||
|
printlog "Debugging enabled, App copy output was:\n$logoutput" DEBUG
|
||||||
|
if [[ $appVerifyStatus -ne 0 ]] ; then
|
||||||
|
#if ! ditto "$appPath" "$targetDir/$appName"; then
|
||||||
|
cleanupAndExit 7 "Error while copying:\n$logoutput" ERROR
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# set ownership to current user
|
# set ownership to current user
|
||||||
if [[ "$currentUser" != "loginwindow" && $SYSTEMOWNER -ne 1 ]]; then
|
if [[ "$currentUser" != "loginwindow" && $SYSTEMOWNER -ne 1 ]]; then
|
||||||
printlog "Changing owner to $currentUser"
|
printlog "Changing owner to $currentUser" WARN
|
||||||
chown -R "$currentUser" "$targetDir/$appName"
|
chown -R "$currentUser" "$targetDir/$appName"
|
||||||
else
|
else
|
||||||
printlog "No user logged in or SYSTEMOWNER=1, setting owner to root:wheel"
|
printlog "No user logged in or SYSTEMOWNER=1, setting owner to root:wheel" WARN
|
||||||
chown -R root:wheel "$targetDir/$appName"
|
chown -R root:wheel "$targetDir/$appName"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user