File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,8 @@ installCommandLineTools() {
8181 if [[ ${cmd_line_tools} ]]; then
8282 echo " Download found - installing"
8383 softwareupdate -i " $cmd_line_tools " --verbose
84+ # 35:43: syntax error: A identifier can’t go after this “"”. (-2740)
85+ # /usr/bin/osascript -e 'do shell script "softwareupdate -i "'"$cmd_line_tools"'" --verbose" with administrator privileges'
8486 else
8587 echo " Download not found"
8688 fi
@@ -111,7 +113,15 @@ installAutoPkg() {
111113 echo " ### Installing AutoPkg..."
112114 echo " ALERT: REQUIRES ADMIN RIGHTS - please enter account password"
113115 echo
114- sudo installer -pkg " /tmp/autopkg-latest.pkg" -target /
116+ echo " ### Prompting for administrator credentials to install AutoPkg..."
117+ if [[ $native_prompt == " yes" ]]; then
118+ # Use native prompt if requested
119+ /usr/bin/osascript -e ' do shell script "installer -pkg /tmp/autopkg-latest.pkg -target /" with administrator privileges'
120+ else
121+ # Use sudo prompt
122+ echo " Please enter your administrator password to install AutoPkg."
123+ sudo installer -pkg /tmp/autopkg-latest.pkg -target /
124+ fi
115125
116126 autopkg_version=$( ${AUTOPKG} version)
117127
251261 case " $1 " in
252262 -f|--force) force_autopkg_update=" yes"
253263 ;;
264+ --prompt) native_prompt=" yes"
265+ ;;
254266 -b|--beta)
255267 force_autopkg_update=" yes"
256268 use_beta=" yes"
You can’t perform that action at this time.
0 commit comments