Skip to content

Commit

Permalink
Work around a mas issue
Browse files Browse the repository at this point in the history
  • Loading branch information
michelegera committed Sep 10, 2018
1 parent f50c534 commit 204fd29
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 13 deletions.
30 changes: 17 additions & 13 deletions os/installs/install_mas_apps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,26 @@ declare -a MAS_APPS=(

main() {

APPLE_ID_EMAIL=''
while [ -z "$APPLE_ID_EMAIL" ]; do
ask 'Please type your Apple ID email: '
APPLE_ID_EMAIL="$(get_answer)"
done
# Temporary commented out, see https://github.com/mas-cli/mas/issues/164

APPLE_ID_PASSWORD=''
while [ -z "$APPLE_ID_PASSWORD" ]; do
ask_for_password 'Please type your Apple ID password: '
APPLE_ID_PASSWORD="$(get_answer)"
done
# APPLE_ID_EMAIL=''
# while [ -z "$APPLE_ID_EMAIL" ]; do
# ask 'Please type your Apple ID email: '
# APPLE_ID_EMAIL="$(get_answer)"
# done

printf '\n'
# APPLE_ID_PASSWORD=''
# while [ -z "$APPLE_ID_PASSWORD" ]; do
# ask_for_password 'Please type your Apple ID password: '
# APPLE_ID_PASSWORD="$(get_answer)"
# done

# printf '\n'

# mas signout &> /dev/null
# mas signin $APPLE_ID_EMAIL $APPLE_ID_PASSWORD &> /dev/null

mas signout &> /dev/null
mas signin $APPLE_ID_EMAIL $APPLE_ID_PASSWORD &> /dev/null
login_to_mas

for app in "${MAS_APPS[@]}" ; do
ID="${app%%:*}"
Expand Down
11 changes: 11 additions & 0 deletions os/installs/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,14 @@ brew_tap() {
return $?

}

login_to_mas() {
print_in_purple 'Please log into the Mac App Store'

open -a '/Applications/App Store.app'

until (mas account > /dev/null);
do
sleep 3
done
}

0 comments on commit 204fd29

Please sign in to comment.