From 095346dfc50e898ed23d9dfa7266cd4efff7b6df Mon Sep 17 00:00:00 2001 From: "T. R. Bernstein" <137705289+trbernstein@users.noreply.github.com> Date: Mon, 1 Jul 2024 22:03:30 +0200 Subject: [PATCH] Delete 07-install-mas-apps Add azw command to install default Mac AppStore apps. --- bin/azw-install-default-mas-apps | 30 ++++++++ ...8-install-fonts.sh => 07-install-fonts.sh} | 0 modules/07-install-mas-apps.sh | 69 ------------------- 3 files changed, 30 insertions(+), 69 deletions(-) create mode 100755 bin/azw-install-default-mas-apps rename modules/{08-install-fonts.sh => 07-install-fonts.sh} (100%) delete mode 100755 modules/07-install-mas-apps.sh diff --git a/bin/azw-install-default-mas-apps b/bin/azw-install-default-mas-apps new file mode 100755 index 0000000..3166d7a --- /dev/null +++ b/bin/azw-install-default-mas-apps @@ -0,0 +1,30 @@ +#!/usr/bin/env zsh +# vi: set ft=zsh tw=80 ts=2 + +function _installMASApp() { + mas install ${id} &> /dev/null +} + +function installMASApp() { + local appName="$1" + local id="$2" + indicateActivity -- "Install ${appName} app" _installMASApp +} + +function main() { + lop -y h1 -- -i 'Install Mac AppStore Apps' + installMASApp Keka 470158793 + installMASApp Pages 409201541 + installMASApp Numbers 409203825 + installMASApp Outbank 1094255754 + installMASApp 'Final Cut Pro' 424389933 + installMASApp GarageBand 682658836 + installMASApp Motion 434290957 + installMASApp Compressor 424390742 + installMASApp 'Logic Pro' 634148309 +} + +if [[ "${ZSH_EVAL_CONTEXT}" == toplevel ]]; then + autoload -w zshlib + main "$@" +fi diff --git a/modules/08-install-fonts.sh b/modules/07-install-fonts.sh similarity index 100% rename from modules/08-install-fonts.sh rename to modules/07-install-fonts.sh diff --git a/modules/07-install-mas-apps.sh b/modules/07-install-mas-apps.sh deleted file mode 100755 index 1f78449..0000000 --- a/modules/07-install-mas-apps.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/env zsh -# vi: set ft=zsh tw=80 ts=2 - -function installMASApp() { - local currentUser="`who am i | cut -d' ' -f1`" - local appName="$1" - local id="$2" - indicateActivity -- "Install ${appName} app" sudo -u ${currentUser} mas install ${id} -} - -function configure_system() { - lop -y h1 -- -i 'Install Mac AppStore Apps' - installMASApp Keka 470158793 - - if ! isDebug; then - installMASApp Pages 409201541 - installMASApp Numbers 409203825 - - installMASApp Outbank 1094255754 - - installMASApp 'Final Cut Pro' 424389933 - installMASApp GarageBand 682658836 - installMASApp Motion 434290957 - installMASApp Compressor 424390742 - installMASApp 'Logic Pro' 634148309 - fi -} - -function getExecPrerequisites() { - cmds=( - [mas]='' - [sudo]='' - [who]='' - [cut]='' - ) -} - -function getQuestions { - questions=( - 'c: logged-in=Have you ensured a user is logged in to the macOS App Store?' - ) -} - -function getUsage() { - read -r -d '' text <<- USAGE - Usage: - $cmdName show-questions [ ]... - $cmdName [-v] [-d FILE] --logged-in ANS - - Install macOS applications from Apple's macOS App Store. - - Options: - -l ANS, --logged-in ANS This option is to ensure, that the caller has - checked that a user is logged in to the App Store. - -d FILE, --logfile FILE Print log message to logfile instead of stdout. - -v, --verbose Be more verbose. - ---- - $cmdName 0.1.0 - Copyright (C) 2022 Rezart Qelibari, Astzweig GmbH & Co. KG - License EUPL-1.2. There is NO WARRANTY, to the extent permitted by law. - USAGE - print -- ${text} -} - -if [[ "${ZSH_EVAL_CONTEXT}" == toplevel ]]; then - test -f "${ASTZWEIG_MACOS_SYSTEM_LIB}" || { echo 'This module requires macos-system library. Please run again with macos-system library provieded as a path in ASTZWEIG_MACOS_SYSTEM_LIB env variable.'; return 10 } - source "${ASTZWEIG_MACOS_SYSTEM_LIB}" - module_main $0 "$@" -fi