mirror of
https://github.com/mtan93/Installomator.git
synced 2026-04-09 06:13:12 +01:00
Further logging, finding pkg only return files
Important change, when we use `find` to locate pkgs. Now only files will be returned.
This commit is contained in:
@@ -400,6 +400,7 @@ installAppWithPath() { # $1: path to app to install in $targetDir
|
|||||||
|
|
||||||
# verify with spctl
|
# verify with spctl
|
||||||
printlog "Verifying: $appPath" INFO
|
printlog "Verifying: $appPath" INFO
|
||||||
|
printlog "App size: $(du -sh "$appPath")" DEBUG
|
||||||
appVerify=$(spctl -a -vv "$appPath" 2>&1 )
|
appVerify=$(spctl -a -vv "$appPath" 2>&1 )
|
||||||
appVerifyStatus=$(echo $?)
|
appVerifyStatus=$(echo $?)
|
||||||
teamID=$(echo $appVerify | awk '/origin=/ {print $NF }' | tr -d '()' )
|
teamID=$(echo $appVerify | awk '/origin=/ {print $NF }' | tr -d '()' )
|
||||||
@@ -537,7 +538,8 @@ installFromDMG() {
|
|||||||
installFromPKG() {
|
installFromPKG() {
|
||||||
# verify with spctl
|
# verify with spctl
|
||||||
printlog "Verifying: $archiveName"
|
printlog "Verifying: $archiveName"
|
||||||
|
printlog "File list: $(ls -lh "$archiveName")" DEBUG
|
||||||
|
printlog "File type: $(file "$archiveName")" DEBUG
|
||||||
spctlOut=$(spctl -a -vv -t install "$archiveName" 2>&1 )
|
spctlOut=$(spctl -a -vv -t install "$archiveName" 2>&1 )
|
||||||
spctlStatus=$(echo $?)
|
spctlStatus=$(echo $?)
|
||||||
printlog "spctlOut is $spctlOut" DEBUG
|
printlog "spctlOut is $spctlOut" DEBUG
|
||||||
@@ -656,7 +658,7 @@ installPkgInDmg() {
|
|||||||
# locate pkg in dmg
|
# locate pkg in dmg
|
||||||
if [[ -z $pkgName ]]; then
|
if [[ -z $pkgName ]]; then
|
||||||
# find first file ending with 'pkg'
|
# find first file ending with 'pkg'
|
||||||
findfiles=$(find "$dmgmount" -iname "*.pkg" -maxdepth 1 )
|
findfiles=$(find "$dmgmount" -iname "*.pkg" -type f -maxdepth 1 )
|
||||||
filearray=( ${(f)findfiles} )
|
filearray=( ${(f)findfiles} )
|
||||||
if [[ ${#filearray} -eq 0 ]]; then
|
if [[ ${#filearray} -eq 0 ]]; then
|
||||||
cleanupAndExit 20 "couldn't find pkg in dmg $archiveName" ERROR
|
cleanupAndExit 20 "couldn't find pkg in dmg $archiveName" ERROR
|
||||||
@@ -691,7 +693,7 @@ installPkgInZip() {
|
|||||||
# locate pkg in zip
|
# locate pkg in zip
|
||||||
if [[ -z $pkgName ]]; then
|
if [[ -z $pkgName ]]; then
|
||||||
# find first file ending with 'pkg'
|
# find first file ending with 'pkg'
|
||||||
findfiles=$(find "$tmpDir" -iname "*.pkg" -maxdepth 2 )
|
findfiles=$(find "$tmpDir" -iname "*.pkg" -type f -maxdepth 2 )
|
||||||
filearray=( ${(f)findfiles} )
|
filearray=( ${(f)findfiles} )
|
||||||
if [[ ${#filearray} -eq 0 ]]; then
|
if [[ ${#filearray} -eq 0 ]]; then
|
||||||
cleanupAndExit 20 "couldn't find pkg in zip $archiveName" ERROR
|
cleanupAndExit 20 "couldn't find pkg in zip $archiveName" ERROR
|
||||||
|
|||||||
@@ -207,8 +207,12 @@ else
|
|||||||
displaynotification "$message" "Error installing $name" ERROR
|
displaynotification "$message" "Error installing $name" ERROR
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
printlog "File list: $(ls -lh "$archiveName")" ERROR
|
||||||
|
printlog "File type: $(file "$archiveName")" ERROR
|
||||||
cleanupAndExit 2 "Error downloading $downloadURL error:\n$logoutput" ERROR
|
cleanupAndExit 2 "Error downloading $downloadURL error:\n$logoutput" ERROR
|
||||||
fi
|
fi
|
||||||
|
printlog "File list: $(ls -lh "$archiveName")" DEBUG
|
||||||
|
printlog "File type: $(file "$archiveName")" DEBUG
|
||||||
printlog "curl output was:\n$logoutput" DEBUG
|
printlog "curl output was:\n$logoutput" DEBUG
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user