diff --git a/bin/create_boot_disk b/bin/create_boot_disk index b47bddc..5e2b486 100755 --- a/bin/create_boot_disk +++ b/bin/create_boot_disk @@ -2,33 +2,33 @@ # Creates macOS boot disk. -printf "macOS Boot Disk Tips\n" -printf " - Use a USB drive (8GB or higher).\n" -printf " - Use Disk Utility to format the USB drive as \"APSF\".\n" -printf " - Use Disk Utility to label the USB drive as \"Untitled\".\n" -printf "\nmacOS Boot Disk Usage:\n" -printf " 1. Insert the USB boot disk into the machine to be upgraded.\n" -printf " 2. Reboot the machine.\n" -printf " 3. Press and hold the POWER key before the Apple logo appears.\n" -printf " 4. Select the USB boot disk from the menu.\n" -printf " 5. Use Disk Utility to delete and/or erase the hard drive including associated partitions.\n" -printf " 6. Use Disk Utility to create a single \"APFS\" drive.\n" -printf " 7. Install the new operating system.\n" -printf "\nmacOS Boot Disk Recovery:\n" -printf " 1. Start/restart the machine.\n" -printf " 2. Press and hold the POWER key before the Apple logo appears.\n" -printf " 3. Wait for the macOS installer to load from the recovery partition.\n" -printf " 4. Use the dialog options to launch Disk Utility, reinstall the system, etc.\n" +printf "%s\n" "macOS Boot Disk Tips" +printf "%s\n" " - Use a USB drive (8GB or higher)." +printf "%s\n" " - Use Disk Utility to format the USB drive as \"APSF\"." +printf "%s\n" " - Use Disk Utility to label the USB drive as \"Untitled\"." +printf "\n%s\n" "macOS Boot Disk Usage:" +printf "%s\n" " 1. Insert the USB boot disk into the machine to be upgraded." +printf "%s\n" " 2. Reboot the machine." +printf "%s\n" " 3. Press and hold the POWER key before the Apple logssssso appears." +printf "%s\n" " 4. Select the USB boot disk from the menu." +printf "%s\n" " 5. Use Disk Utility to delete and/or erase the hard drive including associated partitions." +printf "%s\n" " 6. Use Disk Utility to create a single \"APFS\" drive." +printf "%s\n" " 7. Install the new operating system." +printf "\n%s\n" "macOS Boot Disk Recovery:" +printf "%s\n" " 1. Start/restart the machine." +printf "%s\n" " 2. Press and hold the POWER key before the Apple logo appears." +printf "%s\n" " 3. Wait for the macOS installer to load from the recovery partition." +printf "%s\n" " 4. Use the dialog options to launch Disk Utility, reinstall the system, etc." -printf "\nCreating macOS boot disk...\n" +printf "\n%s\n" "Creating macOS boot disk..." if [[ ! -e "$MAC_OS_BOOT_DISK_CREATOR" ]]; then - printf "ERROR: macOS installer does not exist: $MAC_OS_BOOT_DISK_CREATOR. Use System Preferences → Software Update to download.\n" + printf "%s\n" "ERROR: macOS installer does not exist: $MAC_OS_BOOT_DISK_CREATOR. Use System Preferences → Software Update to download." exit 1 fi if [[ ! -d "$MAC_OS_BOOT_DISK_PATH" ]]; then - printf "ERROR: Boot disk must be mounted at: $MAC_OS_BOOT_DISK_PATH.\n" + printf "%s\n" "ERROR: Boot disk must be mounted at: $MAC_OS_BOOT_DISK_PATH." exit 1 fi diff --git a/bin/install_app_store b/bin/install_app_store index e562d58..2fe1453 100755 --- a/bin/install_app_store +++ b/bin/install_app_store @@ -13,5 +13,5 @@ if [[ -x "$SCRIPT_PATH" ]]; then check_mas_install "$SCRIPT_PATH" else - printf "WARNING: App Store install script does not exist or is not executable.\n" + printf "%s\n" "WARNING: App Store install script does not exist or is not executable." fi diff --git a/bin/install_applications b/bin/install_applications index 477a4f0..c0276c3 100755 --- a/bin/install_applications +++ b/bin/install_applications @@ -12,5 +12,5 @@ SCRIPT_PATH="$MAC_OS_CONFIG_PATH/bin/install_applications" if [[ -x "$SCRIPT_PATH" ]]; then "$SCRIPT_PATH" else - printf "WARNING: Applications install script does not exist or is not executable.\n" + printf "%s\n" "WARNING: Applications install script does not exist or is not executable." fi diff --git a/bin/install_basics b/bin/install_basics index f121741..52bad38 100755 --- a/bin/install_basics +++ b/bin/install_basics @@ -12,5 +12,5 @@ SCRIPT_PATH="$MAC_OS_CONFIG_PATH/bin/install_basics" if [[ -x "$SCRIPT_PATH" ]]; then "$SCRIPT_PATH" else - printf "WARNING: Basic settings script does not exist or is not executable.\n" + printf "%s\n" "WARNING: Basic settings script does not exist or is not executable." fi diff --git a/bin/install_defaults b/bin/install_defaults index 9e27f97..1494f8f 100755 --- a/bin/install_defaults +++ b/bin/install_defaults @@ -12,5 +12,5 @@ SCRIPT_PATH="$MAC_OS_CONFIG_PATH/bin/install_defaults" if [[ -x "$SCRIPT_PATH" ]]; then "$SCRIPT_PATH" else - printf "WARNING: Default settings script does not exist or is not executable.\n" + printf "%s\n" "WARNING: Default settings script does not exist or is not executable." fi diff --git a/bin/install_dev_tools b/bin/install_dev_tools index 5b0c8fe..f26ebfb 100755 --- a/bin/install_dev_tools +++ b/bin/install_dev_tools @@ -1,14 +1,14 @@ #! /usr/bin/env bash -Installs development tooling requirements. +# Installs development tooling requirements. -printf "Installing Xcode CLI tools...\n" +printf "%s\n" "Installing Xcode CLI tools..." xcode-select --install printf "%s\n" "💡 ALT+TAB to view and accept Xcode license window." read -p "Have you completed the Xcode CLI tools install (y/n)? " xcode_response if [[ "$xcode_response" != "y" ]]; then - printf "ERROR: Xcode CLI tools must be installed before proceeding.\n" + printf "%s\n" "ERROR: Xcode CLI tools must be installed before proceeding." exit 1 fi diff --git a/bin/install_extensions b/bin/install_extensions index adc16de..4238a59 100755 --- a/bin/install_extensions +++ b/bin/install_extensions @@ -12,5 +12,5 @@ SCRIPT_PATH="$MAC_OS_CONFIG_PATH/bin/install_extensions" if [[ -x "$SCRIPT_PATH" ]]; then "$SCRIPT_PATH" else - printf "WARNING: Application extensions install script does not exist or is not executable.\n" + printf "%s\n" "WARNING: Application extensions install script does not exist or is not executable." fi diff --git a/bin/install_homebrew_casks b/bin/install_homebrew_casks index b647c49..34cc418 100755 --- a/bin/install_homebrew_casks +++ b/bin/install_homebrew_casks @@ -13,5 +13,5 @@ if [[ -x "$SCRIPT_PATH" ]]; then install_homebrew "$SCRIPT_PATH" else - printf "WARNING: Homebrew Casks install script does not exist or is not executable.\n" + printf "%s\n" "WARNING: Homebrew Casks install script does not exist or is not executable." fi diff --git a/bin/install_homebrew_formulas b/bin/install_homebrew_formulas index c8b8563..13f8fc9 100755 --- a/bin/install_homebrew_formulas +++ b/bin/install_homebrew_formulas @@ -13,5 +13,5 @@ if [[ -x "$SCRIPT_PATH" ]]; then install_homebrew "$SCRIPT_PATH" else - printf "WARNING: Homebrew Formulas install script does not exist or is not executable.\n" + printf "%s\n" "WARNING: Homebrew Formulas install script does not exist or is not executable." fi diff --git a/bin/install_node_packages b/bin/install_node_packages index 66ee4c7..e1c26fd 100755 --- a/bin/install_node_packages +++ b/bin/install_node_packages @@ -13,5 +13,5 @@ if [[ -x "$SCRIPT_PATH" ]]; then install_node "$SCRIPT_PATH" else - printf "WARNING: Node packages install script does not exist or is not executable.\n" + printf "%s\n" "WARNING: Node packages install script does not exist or is not executable." fi diff --git a/bin/install_ruby_gems b/bin/install_ruby_gems index d31451b..70a01a8 100755 --- a/bin/install_ruby_gems +++ b/bin/install_ruby_gems @@ -13,5 +13,5 @@ if [[ -x "$SCRIPT_PATH" ]]; then install_ruby "$SCRIPT_PATH" else - printf "WARNING: Ruby gems install script does not exist or is not executable.\n" + printf "%s\n" "WARNING: Ruby gems install script does not exist or is not executable." fi diff --git a/bin/install_rust_crates b/bin/install_rust_crates index 6600cdd..b153bc0 100755 --- a/bin/install_rust_crates +++ b/bin/install_rust_crates @@ -13,5 +13,5 @@ if [[ -x "$SCRIPT_PATH" ]]; then install_rust "$SCRIPT_PATH" else - printf "WARNING: Rust crates install script does not exist or is not executable.\n" + printf "%s\n" "WARNING: Rust crates install script does not exist or is not executable." fi diff --git a/bin/install_shell b/bin/install_shell index df7b206..f653fec 100755 --- a/bin/install_shell +++ b/bin/install_shell @@ -12,5 +12,5 @@ SCRIPT_PATH="$MAC_OS_CONFIG_PATH/bin/install_shell" if [[ -x "$SCRIPT_PATH" ]]; then "$SCRIPT_PATH" else - printf "WARNING: Shell script does not exist or is not executable.\n" + printf "%s\n" "WARNING: Shell script does not exist or is not executable." fi diff --git a/bin/restore_backup b/bin/restore_backup index 9bb01fe..aca97e3 100755 --- a/bin/restore_backup +++ b/bin/restore_backup @@ -12,5 +12,5 @@ SCRIPT_PATH="$MAC_OS_CONFIG_PATH/bin/restore_backup" if [[ -x "$SCRIPT_PATH" ]]; then "$SCRIPT_PATH" else - printf "WARNING: Restore backup script does not exist or is not executable.\n" + printf "%s\n" "WARNING: Restore backup script does not exist or is not executable." fi diff --git a/bin/run b/bin/run index 0b070b4..fe2c71a 100755 --- a/bin/run +++ b/bin/run @@ -11,13 +11,13 @@ source lib/verifiers.sh if [[ -e "$MAC_OS_CONFIG_PATH" ]]; then source "$MAC_OS_CONFIG_PATH/lib/settings.sh" else - printf "ERROR: Unable to load macOS configuration: $MAC_OS_CONFIG_PATH.\n\n" - printf "Please check the following before continuing:\n" - printf " • Download the default macOS configuration here: https://github.com/bkuhlmann/mac_os-config.\n" - printf " • Customize as necessary for your setup or fork the project and make your own configuration.\n" - printf " • When finished, your folder structure should look like this:\n" - printf " • /mac_os:\n" - printf " • /mac_os-config:\n" + printf "%s\n\n" "ERROR: Unable to load macOS configuration: $MAC_OS_CONFIG_PATH." + printf "%s\n" "Please check the following before continuing:" + printf "%s\n" " • Download the default macOS configuration here: https://github.com/bkuhlmann/mac_os-config." + printf "%s\n" " • Customize as necessary for your setup or fork the project and make your own configuration." + printf "%s\n" " • When finished, your folder structure should look like this:" + printf "%s\n" " • /mac_os:" + printf "%s\n" " • /mac_os-config:" exit 1 fi @@ -25,37 +25,37 @@ configure_environment while true; do if [[ $# == 0 ]]; then - printf "\nUsage: run OPTION\n" - printf "\nOSX Options:\n" - printf " Boot:\n" - printf " B: Create boot disk.\n" - printf " Install:\n" - printf " b: Install basics.\n" - printf " t: Install development tools.\n" - printf " hf: Install Homebrew Formulas.\n" - printf " hc: Install Homebrew Casks.\n" - printf " m: Install Mac App Store software.\n" - printf " a: Install application software.\n" - printf " x: Install application software extensions.\n" - printf " d: Install defaults.\n" - printf " s: Install shell.\n" - printf " r: Restore backups.\n" - printf " i: Install all (i.e. executes all of the above steps in order listed).\n" - printf " Libraries:\n" - printf " np: Install Node packages.\n" - printf " rg: Install Ruby gems.\n" - printf " rc: Install Rust crates.\n" - printf " l: Install libraries (i.e. executes all of the above steps in order listed).\n" - printf " Manage:\n" - printf " c: Check status of managed software.\n" - printf " C: Caffeinate machine.\n" - printf " w: Clean work (temp) directory.\n" - printf " q: Quit/Exit.\n\n" + printf "\n%s\n" "Usage: run OPTION" + printf "\n%s\n" "OSX Options:" + printf "%s\n" " Boot:" + printf "%s\n" " B: Create boot disk." + printf "%s\n" " Install:" + printf "%s\n" " b: Install basics." + printf "%s\n" " t: Install development tools." + printf "%s\n" " hf: Install Homebrew Formulas." + printf "%s\n" " hc: Install Homebrew Casks." + printf "%s\n" " m: Install Mac App Store software." + printf "%s\n" " a: Install application software." + printf "%s\n" " x: Install application software extensions." + printf "%s\n" " d: Install defaults." + printf "%s\n" " s: Install shell." + printf "%s\n" " r: Restore backups." + printf "%s\n" " i: Install all (i.e. executes all of the above steps in order listed)." + printf "%s\n" " Libraries:" + printf "%s\n" " np: Install Node packages." + printf "%s\n" " rg: Install Ruby gems." + printf "%s\n" " rc: Install Rust crates." + printf "%s\n" " l: Install libraries (i.e. executes all of the above steps in order listed)." + printf "%s\n" " Manage:" + printf "%s\n" " c: Check status of managed software." + printf "%s\n" " C: Caffeinate machine." + printf "%s\n" " w: Clean work (temp) directory." + printf "%s\n\n" " q: Quit/Exit." read -p "Enter selection: " response printf "\n" - process_option $response + process_option "$response" else - process_option $1 + process_option "$1" fi break