Compare commits
33 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0bafd0ea25 | ||
|
|
045a254219 | ||
|
|
113f3b88f5 | ||
|
|
4b77ecefd5 | ||
|
|
fc2cca07cf | ||
|
|
24bf3a7e62 | ||
|
|
4159fbce71 | ||
|
|
1ef42c9040 | ||
|
|
a6e170cead | ||
|
|
691d87d0f1 | ||
|
|
5e5ad4100e | ||
|
|
93151ac7d2 | ||
|
|
966b1596be | ||
|
|
5991bd6da6 | ||
|
|
b3f799acfc | ||
|
|
ea4027714a | ||
|
|
4f599099a1 | ||
|
|
c161493c32 | ||
|
|
387241227a | ||
|
|
ecf85b4526 | ||
|
|
06f6302b9a | ||
|
|
7a9bb00877 | ||
|
|
2a01bac2b0 | ||
|
|
b2b4d49c52 | ||
|
|
0945809dc4 | ||
|
|
b270852fb5 | ||
|
|
4dc5f3d363 | ||
|
|
6169e0566e | ||
|
|
1686b0c98f | ||
|
|
3aa3ea59e7 | ||
|
|
ae40574cd7 | ||
|
|
5786fef97b | ||
|
|
efa421db4e |
1
.github/FUNDING.yml
vendored
Normal file
1
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
github: [bkuhlmann]
|
||||
@@ -1 +1 @@
|
||||
3.1.1
|
||||
3.2.0
|
||||
|
||||
@@ -2,9 +2,9 @@ cff-version: 1.2.0
|
||||
message: Please use the following metadata when citing this project in your work.
|
||||
title: macOS
|
||||
abstract: Provides a shell based framework for automating the setup of a macOS machine.
|
||||
version: 15.0.2
|
||||
version: 16.0.1
|
||||
license: Hippocratic-2.1
|
||||
date-released: 2022-03-03
|
||||
date-released: 2023-02-05
|
||||
authors:
|
||||
- family-names: Kuhlmann
|
||||
given-names: Brooke
|
||||
|
||||
4
Gemfile
4
Gemfile
@@ -4,6 +4,6 @@ ruby File.read(".ruby-version").strip
|
||||
|
||||
source "https://rubygems.org"
|
||||
|
||||
gem "caliber", "~> 0.2"
|
||||
gem "git-lint", "~> 3.2"
|
||||
gem "caliber", "~> 0.25"
|
||||
gem "git-lint", "~> 5.0"
|
||||
gem "rake", "~> 13.0"
|
||||
|
||||
@@ -45,7 +45,7 @@ image::https://www.alchemists.io/images/screencasts/mac_os/cover.svg[Screencast,
|
||||
|
||||
== Requirements
|
||||
|
||||
. link:https://www.apple.com/macos/monterey[macOS Monterey]
|
||||
. link:https://www.apple.com/macos/ventura[macOS Ventura]
|
||||
. link:https://developer.apple.com/xcode[Xcode]
|
||||
|
||||
== Setup
|
||||
@@ -56,7 +56,7 @@ To install, run:
|
||||
----
|
||||
git clone https://github.com/bkuhlmann/mac_os.git
|
||||
cd mac_os
|
||||
git checkout 15.0.2
|
||||
git checkout 16.0.1
|
||||
----
|
||||
|
||||
== Usage
|
||||
@@ -178,7 +178,7 @@ link:https://www.alchemists.io/projects/mac_os-config[macOS Config] project for
|
||||
|
||||
* `lib/settings.sh`: Defines global settings for software applications, extensions, etc.
|
||||
|
||||
== Troubleshooting
|
||||
=== Troubleshooting
|
||||
|
||||
* *Pi-hole*: When using link:https://pi-hole.net[Pi-hole], you might need to temporarily disable
|
||||
prior to upgrading as you might experience various errors with Apple not being able to detect an
|
||||
|
||||
3
Rakefile
3
Rakefile
@@ -1,8 +1,9 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "git/lint/rake/setup"
|
||||
require "git/lint/rake/register"
|
||||
require "rubocop/rake_task"
|
||||
|
||||
Git::Lint::Rake::Register.call
|
||||
RuboCop::RakeTask.new
|
||||
|
||||
task default: %i[git_lint rubocop]
|
||||
|
||||
@@ -1,5 +1,48 @@
|
||||
= Versions
|
||||
|
||||
== 16.0.1 (2023-02-05)
|
||||
|
||||
* Added Rake binstub - Brooke Kuhlmann
|
||||
* Updated to Caliber 0.21.0 - Brooke Kuhlmann
|
||||
* Updated to Caliber 0.25.0 - Brooke Kuhlmann
|
||||
* Updated to Git Lint 5.0.0 - Brooke Kuhlmann
|
||||
|
||||
== 16.0.0 (2022-12-25)
|
||||
|
||||
* Fixed Node installer to detect Node and version - Brooke Kuhlmann
|
||||
* Fixed Ruby installer to pass configuration options - Brooke Kuhlmann
|
||||
* Updated README sections - Brooke Kuhlmann
|
||||
* Updated installs for basic, default, and shell scripts - Brooke Kuhlmann
|
||||
* Updated run script to distinquish between applications and libraries - Brooke Kuhlmann
|
||||
* Updated to Caliber 0.11.0 - Brooke Kuhlmann
|
||||
* Updated to Caliber 0.16.0 - Brooke Kuhlmann
|
||||
* Updated to Ruby 3.1.3 - Brooke Kuhlmann
|
||||
* Updated to Ruby 3.2.0 - Brooke Kuhlmann
|
||||
* Updated to macOS Ventura - Brooke Kuhlmann
|
||||
* Removed configure software script - Brooke Kuhlmann
|
||||
* Removed mention of Intel CPUs from boot disk instructions - Brooke Kuhlmann
|
||||
* Removed system update from Ruby install - Brooke Kuhlmann
|
||||
* Removed uninstallers and reinstallers - Brooke Kuhlmann
|
||||
* Refactored download file function to use multi-line curl command - Brooke Kuhlmann
|
||||
|
||||
== 15.0.5 (2022-05-07)
|
||||
|
||||
* Updated to Caliber 0.6.0 - Brooke Kuhlmann
|
||||
* Updated to Caliber 0.7.0 - Brooke Kuhlmann
|
||||
* Updated to Caliber 0.8.0 - Brooke Kuhlmann
|
||||
|
||||
== 15.0.4 (2022-04-17)
|
||||
|
||||
* Added GitHub sponsorship configuration - Brooke Kuhlmann
|
||||
* Updated to Caliber 0.4.0 - Brooke Kuhlmann
|
||||
* Updated to Caliber 0.5.0 - Brooke Kuhlmann
|
||||
* Updated to Git Lint 4.0.0 - Brooke Kuhlmann
|
||||
* Updated to Ruby 3.1.2 - Brooke Kuhlmann
|
||||
|
||||
== 15.0.3 (2022-03-16)
|
||||
|
||||
* Fixed Homebrew install to initially default to ZSH - Brooke Kuhlmann
|
||||
|
||||
== 15.0.2 (2022-03-03)
|
||||
|
||||
* Fixed Hippocratic License to be 2.1.0 version - Brooke Kuhlmann
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
#! /usr/bin/env bash
|
||||
|
||||
# Configures installed software.
|
||||
|
||||
set -o nounset
|
||||
set -o errexit
|
||||
set -o pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
SCRIPT_PATH="$MAC_OS_CONFIG_PATH/bin/configure_software"
|
||||
|
||||
if [[ -x "$SCRIPT_PATH" ]]; then
|
||||
"$SCRIPT_PATH"
|
||||
else
|
||||
printf "WARNING: Configure software script does not exist or is not executable.\n"
|
||||
fi
|
||||
@@ -4,19 +4,19 @@
|
||||
|
||||
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 \"Mac OS Extended (Journaled)\".\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. Hold the POWER (Silicon) or OPTION (Intel) key before the Apple logo appears.\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 as a \"GUID Partition Table\".\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. Hold the POWER (Silicon) or COMMAND+R (Intel) keys before the Apple logo appears.\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"
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#! /usr/bin/env bash
|
||||
|
||||
# Applies basic system settings.
|
||||
# Installs basic system settings.
|
||||
|
||||
set -o nounset
|
||||
set -o errexit
|
||||
set -o pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
SCRIPT_PATH="$MAC_OS_CONFIG_PATH/bin/apply_basic_settings"
|
||||
SCRIPT_PATH="$MAC_OS_CONFIG_PATH/bin/install_basics"
|
||||
|
||||
if [[ -x "$SCRIPT_PATH" ]]; then
|
||||
"$SCRIPT_PATH"
|
||||
@@ -1,13 +1,13 @@
|
||||
#! /usr/bin/env bash
|
||||
|
||||
# Applies default settings.
|
||||
# Installs system and application default settings.
|
||||
|
||||
set -o nounset
|
||||
set -o errexit
|
||||
set -o pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
SCRIPT_PATH="$MAC_OS_CONFIG_PATH/bin/apply_default_settings"
|
||||
SCRIPT_PATH="$MAC_OS_CONFIG_PATH/bin/install_defaults"
|
||||
|
||||
if [[ -x "$SCRIPT_PATH" ]]; then
|
||||
"$SCRIPT_PATH"
|
||||
@@ -1,16 +0,0 @@
|
||||
#! /usr/bin/env bash
|
||||
|
||||
# Installs dotfiles.
|
||||
|
||||
set -o nounset
|
||||
set -o errexit
|
||||
set -o pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
SCRIPT_PATH="$MAC_OS_CONFIG_PATH/bin/install_dotfiles"
|
||||
|
||||
if [[ -x "$SCRIPT_PATH" ]]; then
|
||||
"$SCRIPT_PATH"
|
||||
else
|
||||
printf "WARNING: Dotfiles install script does not exist or is not executable.\n"
|
||||
fi
|
||||
16
bin/install_shell
Executable file
16
bin/install_shell
Executable file
@@ -0,0 +1,16 @@
|
||||
#! /usr/bin/env bash
|
||||
|
||||
# Installs shell.
|
||||
|
||||
set -o nounset
|
||||
set -o errexit
|
||||
set -o pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
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"
|
||||
fi
|
||||
6
bin/rake
Executable file
6
bin/rake
Executable file
@@ -0,0 +1,6 @@
|
||||
#! /usr/bin/env ruby
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "bundler/setup"
|
||||
|
||||
load Gem.bin_path "rake", "rake"
|
||||
20
bin/run
20
bin/run
@@ -4,9 +4,7 @@
|
||||
|
||||
source lib/installers.sh
|
||||
source lib/options.sh
|
||||
source lib/reinstallers.sh
|
||||
source lib/settings.sh
|
||||
source lib/uninstallers.sh
|
||||
source lib/utilities.sh
|
||||
source lib/verifiers.sh
|
||||
|
||||
@@ -32,29 +30,25 @@ while true; do
|
||||
printf " Boot:\n"
|
||||
printf " B: Create boot disk.\n"
|
||||
printf " Install:\n"
|
||||
printf " b: Apply basic settings.\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 " df: Install dotfiles.\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 " d: Apply default settings.\n"
|
||||
printf " cs: Configure installed software.\n"
|
||||
printf " i: Install all (i.e. executes all of the above steps in order listed).\n"
|
||||
printf " Restore:\n"
|
||||
printf " R: Restore settings from backup.\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 " ua: Uninstall application software.\n"
|
||||
printf " ux: Uninstall application software extension.\n"
|
||||
printf " ra: Reinstall application software.\n"
|
||||
printf " rx: Reinstall application software extension.\n"
|
||||
printf " w: Clean work (temp) directory.\n"
|
||||
printf " q: Quit/Exit.\n\n"
|
||||
read -p "Enter selection: " response
|
||||
|
||||
@@ -11,8 +11,16 @@ download_file() {
|
||||
|
||||
printf "%s\n" "Downloading $1..."
|
||||
clean_work_path
|
||||
mkdir $MAC_OS_WORK_PATH
|
||||
curl --header "$http_header" --location --retry 3 --retry-delay 5 --fail --silent --show-error "$url" >> "$MAC_OS_WORK_PATH/$file_name"
|
||||
mkdir "$MAC_OS_WORK_PATH"
|
||||
|
||||
curl --header "$http_header" \
|
||||
--location \
|
||||
--retry 3 \
|
||||
--retry-delay 5 \
|
||||
--fail \
|
||||
--silent \
|
||||
--show-error \
|
||||
"$url" >> "$MAC_OS_WORK_PATH/$file_name"
|
||||
}
|
||||
export -f download_file
|
||||
|
||||
@@ -139,6 +147,8 @@ export -f install_git_project
|
||||
install_homebrew() {
|
||||
if ! command -v brew > /dev/null; then
|
||||
/bin/bash -c "$(curl --location --fail --silent --show-error https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||
echo "eval \"($(get_homebrew_bin_root)/brew shellenv)\"" > $HOME/.zprofile
|
||||
eval "$($(get_homebrew_bin_root)/brew shellenv)"
|
||||
fi
|
||||
}
|
||||
export -f install_homebrew
|
||||
@@ -191,8 +201,8 @@ export -f install_program
|
||||
# Installs Node.
|
||||
# Parameters: None.
|
||||
install_node() {
|
||||
if ! command -v fnm > /dev/null; then
|
||||
$(get_homebrew_bin_root)/fnm install --lts
|
||||
if [[ ! -x "$(command -v node)" ]]; then
|
||||
"$(get_homebrew_bin_root)/fnm" install --latest
|
||||
fi
|
||||
}
|
||||
export -f install_node
|
||||
@@ -203,9 +213,11 @@ install_ruby() {
|
||||
local version="$(cat $HOME/.ruby-version | tr -d '\n')"
|
||||
|
||||
if [[ ! -x "$(command -v ruby)" && -n $(ruby --version | grep --quiet "$version") ]]; then
|
||||
$(get_homebrew_bin_root)/frum install "$version"
|
||||
$(get_homebrew_bin_root)/frum local "$version"
|
||||
gem update --system && gem update
|
||||
"$(get_homebrew_bin_root)"/frum install "$version" \
|
||||
--with-openssl-dir="$(brew --prefix openssl)" \
|
||||
--enable-shared \
|
||||
--disable-silent-rules
|
||||
"$(get_homebrew_bin_root)"/frum local "$version"
|
||||
fi
|
||||
}
|
||||
export -f install_ruby
|
||||
|
||||
@@ -9,7 +9,7 @@ process_option() {
|
||||
'B')
|
||||
bin/create_boot_disk;;
|
||||
'b')
|
||||
bin/apply_basic_settings;;
|
||||
bin/install_basics;;
|
||||
't')
|
||||
bin/install_dev_tools;;
|
||||
'hf')
|
||||
@@ -22,38 +22,36 @@ process_option() {
|
||||
bin/install_applications;;
|
||||
'x')
|
||||
bin/install_extensions;;
|
||||
'df')
|
||||
bin/install_dotfiles;;
|
||||
'np')
|
||||
bin/install_node_packages;;
|
||||
'rg')
|
||||
bin/install_ruby_gems;;
|
||||
'rc')
|
||||
bin/install_rust_crates;;
|
||||
'd')
|
||||
bin/apply_default_settings;;
|
||||
'cs')
|
||||
bin/configure_software;;
|
||||
bin/install_defaults;;
|
||||
's')
|
||||
bin/install_shell;;
|
||||
'r')
|
||||
bin/restore_backup;;
|
||||
'i')
|
||||
caffeinate_machine
|
||||
bin/apply_basic_settings
|
||||
bin/install_basics
|
||||
bin/install_dev_tools
|
||||
bin/install_homebrew_formulas
|
||||
bin/install_homebrew_casks
|
||||
bin/install_app_store
|
||||
bin/install_applications
|
||||
bin/install_extensions
|
||||
bin/install_dotfiles
|
||||
bin/install_defaults
|
||||
bin/install_shell
|
||||
bin/restore_backup
|
||||
clean_work_path;;
|
||||
'np')
|
||||
bin/install_node_packages;;
|
||||
'rg')
|
||||
bin/install_ruby_gems;;
|
||||
'rc')
|
||||
bin/install_rust_crates;;
|
||||
'l')
|
||||
bin/install_node_packages
|
||||
bin/install_ruby_gems
|
||||
bin/install_rust_crates
|
||||
bin/apply_default_settings
|
||||
bin/configure_software
|
||||
clean_work_path;;
|
||||
'R')
|
||||
caffeinate_machine
|
||||
bin/restore_backup;;
|
||||
'c')
|
||||
bin/install_rust_crates;;
|
||||
'c')
|
||||
verify_homebrew_formulas
|
||||
verify_homebrew_casks
|
||||
verify_app_store_applications
|
||||
@@ -64,14 +62,6 @@ process_option() {
|
||||
verify_rust_crates;;
|
||||
'C')
|
||||
caffeinate_machine;;
|
||||
'ua')
|
||||
uninstall_application;;
|
||||
'ux')
|
||||
uninstall_extension;;
|
||||
'ra')
|
||||
reinstall_application;;
|
||||
'rx')
|
||||
reinstall_extension;;
|
||||
'w')
|
||||
clean_work_path;;
|
||||
'q');;
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
#! /usr/bin/env bash
|
||||
|
||||
# Defines reinstall functions.
|
||||
|
||||
# Reinstall application.
|
||||
reinstall_application() {
|
||||
uninstall_application
|
||||
bin/install_applications
|
||||
}
|
||||
export -f reinstall_application
|
||||
|
||||
# Reinstall extension.
|
||||
reinstall_extension() {
|
||||
uninstall_extension
|
||||
bin/install_extensions
|
||||
}
|
||||
export -f reinstall_extension
|
||||
@@ -5,7 +5,7 @@ set -o errexit
|
||||
set -o pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
export MAC_OS_BOOT_DISK_CREATOR="/Applications/Install macOS Monterey.app/Contents/Resources/createinstallmedia"
|
||||
export MAC_OS_BOOT_DISK_CREATOR="/Applications/Install macOS Ventura.app/Contents/Resources/createinstallmedia"
|
||||
export MAC_OS_BOOT_DISK_PATH="/Volumes/Untitled"
|
||||
export MAC_OS_WORK_PATH=/tmp/downloads
|
||||
export MAC_OS_CONFIG_PATH="../mac_os-config"
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
#! /usr/bin/env bash
|
||||
|
||||
# Defines uninstall functions.
|
||||
|
||||
# Uninstalls selected application.
|
||||
uninstall_application() {
|
||||
# Only use environment keys that end with "APP_NAME".
|
||||
local keys=($(set | awk -F "=" '{print $1}' | grep ".*APP_NAME"))
|
||||
|
||||
printf "Select application to uninstall:\n"
|
||||
for ((index = 0; index < ${#keys[*]}; index++)); do
|
||||
local app_file="${!keys[$index]}"
|
||||
printf " $index: ${app_file}\n"
|
||||
done
|
||||
printf " q: Quit/Exit\n\n"
|
||||
|
||||
read -p "Enter selection: " response
|
||||
printf "\n"
|
||||
|
||||
local regex="^[0-9]+$"
|
||||
if [[ $response =~ $regex ]]; then
|
||||
local app_file="${!keys[$response]}"
|
||||
local app_path=$(get_install_path "${app_file}")
|
||||
sudo rm -rf "$app_path"
|
||||
printf "Uninstalled: ${app_path}\n"
|
||||
fi
|
||||
}
|
||||
export -f uninstall_application
|
||||
|
||||
# Uninstalls selected extension.
|
||||
uninstall_extension() {
|
||||
# Only use environment keys that end with "EXTENSION_PATH".
|
||||
local keys=($(set | awk -F "=" '{print $1}' | grep ".*EXTENSION_PATH"))
|
||||
|
||||
printf "Select extension to uninstall:\n"
|
||||
for ((index = 0; index < ${#keys[*]}; index++)); do
|
||||
local extension_path="${!keys[$index]}"
|
||||
printf " $index: ${extension_path}\n"
|
||||
done
|
||||
printf " q: Quit/Exit\n\n"
|
||||
|
||||
read -p "Enter selection: " response
|
||||
printf "\n"
|
||||
|
||||
local regex="^[0-9]+$"
|
||||
if [[ $response =~ $regex ]]; then
|
||||
local extension_path="${!keys[$response]}"
|
||||
rm -rf "${extension_path}"
|
||||
printf "Uninstalled: ${extension_path}\n"
|
||||
fi
|
||||
}
|
||||
export -f uninstall_extension
|
||||
Reference in New Issue
Block a user