Compare commits

...

35 Commits

Author SHA1 Message Date
Brooke Kuhlmann
33fe1c7003 Added version release notes 2023-09-28 19:49:27 -06:00
Brooke Kuhlmann
605b1e4c3f Updated to macOS Sonoma
Necessary to install and make use of the latest Apple Operating System.

Milestone: major
2023-09-28 19:42:25 -06:00
Brooke Kuhlmann
2170941383 Added Debug gem
Necessary for debugging purposes but also for running global health scripts across all projects (including this one).
2023-06-22 09:49:02 -06:00
Brooke Kuhlmann
63ef52185b Added version release notes 2023-06-19 16:59:56 -06:00
Brooke Kuhlmann
74da03bc07 Updated to Caliber 0.35.0
[Caliber](https://alchemists.io/projects/caliber/versions).
2023-06-16 14:58:38 -06:00
Brooke Kuhlmann
ada1b73c13 Updated to Git Lint 6.0.0
[Details](https://alchemists.io/projects/git-lint/versions).
2023-06-16 13:06:42 -06:00
Brooke Kuhlmann
d196d18641 Updated to Refinements 11.0.0
[Details](https://alchemists.io/projects/refinements/versions).
2023-06-13 10:00:14 -06:00
Brooke Kuhlmann
a360bf535a Added version release notes 2023-05-18 08:22:37 -05:00
Brooke Kuhlmann
f5c6b6d40e Updated to Caliber 0.30.0
[Details](https://alchemists.io/projects/caliber/versions).
2023-04-12 06:40:26 -06:00
Brooke Kuhlmann
bd3caab3fc Added version release notes 2023-04-02 10:50:32 -06:00
Brooke Kuhlmann
2f0fa77831 Fixed programs without extensions to install to user directory
Necessary to ensure the Homebrew directory remains clean and is *only* managed by Homebrew. All other programs are downloaded straight from the provider and placed in the `/usr/local/bin` instead.
2023-03-30 14:50:26 -06:00
Brooke Kuhlmann
017f79442b Updated to Ruby 3.2.2
[Details](https://www.ruby-lang.org/en/news/2023/03/30/ruby-3-2-2-released).
2023-03-30 14:50:20 -06:00
Brooke Kuhlmann
cf648adae7 Updated site URLs to use bare domain
Necessary to point to `https://alchemists.io` instead of `https://www.alchemists.io` for short URL convenience. Both URLs work but use of `https://alchemists.io` is now preferred.
2023-02-19 11:22:36 -07:00
Brooke Kuhlmann
af7aa4d0d0 Updated to Ruby 3.2.1
[Details](https://www.ruby-lang.org/en/news/2023/02/08/ruby-3-2-1-released).
2023-02-08 12:29:22 -07:00
Brooke Kuhlmann
0bafd0ea25 Added version release notes 2023-02-05 10:43:52 -07:00
Brooke Kuhlmann
045a254219 Updated to Caliber 0.25.0
[Details](https://www.alchemists.io/projects/caliber/versions).
2023-02-05 10:28:38 -07:00
Brooke Kuhlmann
113f3b88f5 Added Rake binstub
Necessary to reduce typing and be consistent with existing binstub use.
2023-01-22 09:31:11 -07:00
Brooke Kuhlmann
4b77ecefd5 Updated to Git Lint 5.0.0
[Details](https://www.alchemists.io/projects/git-lint/versions).
2022-12-27 17:50:49 -07:00
Brooke Kuhlmann
fc2cca07cf Updated to Caliber 0.21.0
[Details](https://www.alchemists.io/projects/caliber/versions).
2022-12-27 17:32:46 -07:00
Brooke Kuhlmann
24bf3a7e62 Added version release notes 2022-12-25 19:37:00 -07:00
Brooke Kuhlmann
4159fbce71 Updated run script to distinquish between applications and libraries
Necessary to improve the install reliability of software and
associated libraries (extensions). There is now a split between core
installation of applications and associated libraries. This is a loose
split since everything in the *Install* category is mostly
applications but also contains related setup while the *Libraries*
category requires a machine reboot so the fully configured environment
is loaded to ensure all libraries install properly.

The specifics of these changes will be handled in the corresponding
macOS Configuration project.
2022-12-25 08:42:43 -07:00
Brooke Kuhlmann
1ef42c9040 Updated installs for basic, default, and shell scripts
Improves name consistency by using the same `install_` prefix for all
install scripts.

The dotfiles script was renamed as a shell script since this is now a
dedicated shell configuration script so people can configure their
default shell as they like. Use of this new shell script will be
configured in a future commit.
2022-12-25 08:42:43 -07:00
Brooke Kuhlmann
a6e170cead Removed system update from Ruby install
Necessary to reduce duplicated effort found in the macOS Configuration
project plus this allows people to customize their Ruby gem install
further in case they don't want this stipulation.
2022-12-25 08:42:42 -07:00
Brooke Kuhlmann
691d87d0f1 Removed mention of Intel CPUs from boot disk instructions
Only Silicon machines are supported now.
2022-12-25 08:42:42 -07:00
Brooke Kuhlmann
5e5ad4100e Removed configure software script
No longer necessary as this was originally meant to be a catch all for
any final software setup which has proven to not be all that useful.
2022-12-25 08:42:42 -07:00
Brooke Kuhlmann
93151ac7d2 Removed uninstallers and reinstallers
These are seldom used and native support via Homebrew, for example, is
better than what these scripts can do. This also reduces additional
maintenance burden on this project.
2022-12-25 08:42:42 -07:00
Brooke Kuhlmann
966b1596be Fixed Node installer to detect Node and version
Ensures the latest version of Node is installed as managed by Fast
Node Manager (FNM). Behavior is similar to using Frum to manage Ruby
versions except FNM has the additional feature of computing latest
version instead.
2022-12-25 08:42:42 -07:00
Brooke Kuhlmann
5991bd6da6 Refactored download file function to use multi-line curl command
Improves readability so the command isn't word wrapped.
2022-12-25 08:42:42 -07:00
Brooke Kuhlmann
b3f799acfc Fixed Ruby installer to pass configuration options
Necessary to ensure Ruby installs with the correct version of OpenSSL
with a few other options that helps with the successful install of
Ruby.
2022-12-25 08:42:42 -07:00
Brooke Kuhlmann
ea4027714a Updated to Ruby 3.2.0
Necessary to pick up latest version with new features, bug fixes, new
Data primitive, Web Assembly support, and much more.

https: //www.ruby-lang.org/en/news/2022/12/06/ruby-3-2-0-rc1-released
2022-12-25 08:42:42 -07:00
Brooke Kuhlmann
4f599099a1 Updated to Ruby 3.1.3
Necessary to address the following security issue:

    CVE-2021-33621: HTTP response splitting in CGI

This also fixes a build failure with Xcode 14 and macOS 13 (Ventura).
2022-11-24 08:07:44 -07:00
Brooke Kuhlmann
c161493c32 Updated to macOS Ventura
Necessary to be compatible with the latest version of the macOS
operating system.
2022-10-24 18:43:09 -06:00
Brooke Kuhlmann
387241227a Updated to Caliber 0.16.0
Necessary to pick up latest RuboCop changes.
2022-10-22 08:11:36 -06:00
Brooke Kuhlmann
ecf85b4526 Updated README sections
Necessary to clean up wording and be more consistent with other
projects.
2022-09-16 11:32:51 -06:00
Brooke Kuhlmann
06f6302b9a Updated to Caliber 0.11.0
[Details](https://www.alchemists.io/projects/caliber).
2022-07-14 19:46:13 -06:00
20 changed files with 151 additions and 195 deletions

View File

@@ -1 +1 @@
3.1.2 3.2.2

View File

@@ -1,10 +1,10 @@
cff-version: 1.2.0 cff-version: 1.2.0
message: Please use the following metadata when citing this project in your work. message: Please use the following metadata when citing this project in your work.
title: macOS title: macOS
abstract: Provides a shell based framework for automating the setup of a macOS machine. abstract: Shell scripts for automated macOS machine setup.
version: 15.0.5 version: 17.0.0
license: Hippocratic-2.1 license: Hippocratic-2.1
date-released: 2022-05-07 date-released: 2023-09-28
authors: authors:
- family-names: Kuhlmann - family-names: Kuhlmann
given-names: Brooke given-names: Brooke
@@ -17,5 +17,5 @@ keywords:
- automation - automation
- setup - setup
- recovery - recovery
repository-code: https://www.alchemists.io/projects/mac_os repository-code: https://alchemists.io/projects/mac_os
repository-artifact: https://www.alchemists.io/projects/mac_os repository-artifact: https://alchemists.io/projects/mac_os

View File

@@ -4,6 +4,7 @@ ruby File.read(".ruby-version").strip
source "https://rubygems.org" source "https://rubygems.org"
gem "caliber", "~> 0.8" gem "caliber", "~> 0.35"
gem "git-lint", "~> 4.0" gem "debug", "~> 1.8"
gem "git-lint", "~> 6.0"
gem "rake", "~> 13.0" gem "rake", "~> 13.0"

View File

@@ -8,13 +8,13 @@ Shell scripts for automated macOS machine setup.
This project is a framework for automating the setup of a macOS machine. In order to illustrate the This project is a framework for automating the setup of a macOS machine. In order to illustrate the
potential of what this project can do, please see the companion potential of what this project can do, please see the companion
link:https://www.alchemists.io/projects/mac_os-config[macOS Config] project for details. The _macOS link:https://alchemists.io/projects/mac_os-config[macOS Config] project for details. The _macOS
Config_ project is an opinionated configuration which meets the needs of my development environment Config_ project is an opinionated configuration which meets the needs of my development environment
but is also meant to serve as an example and guide for building your own personalized setup. Here is but is also meant to serve as an example and guide for building your own personalized setup. Here is
how the two projects are meant to be used: how the two projects are meant to be used:
* *macOS* (this project) - The foundational framework for building custom macOS machine setups. * *macOS* (this project) - The foundational framework for building custom macOS machine setups.
* *link:https://www.alchemists.io/projects/mac_os-config[macOS Configuration]* - The layer on top of * *link:https://alchemists.io/projects/mac_os-config[macOS Configuration]* - The layer on top of
this _macOS_ project which defines a custom machine implementation. The project is meant to be this _macOS_ project which defines a custom machine implementation. The project is meant to be
forked for as many custom machine setups as needed. forked for as many custom machine setups as needed.
@@ -40,12 +40,12 @@ toc::[]
== Screencast == Screencast
[link=https://www.alchemists.io/screencasts/mac_os] [link=https://alchemists.io/screencasts/mac_os]
image::https://www.alchemists.io/images/screencasts/mac_os/cover.svg[Screencast,600,240,role=focal_point] image::https://alchemists.io/images/screencasts/mac_os/cover.svg[Screencast,600,240,role=focal_point]
== Requirements == Requirements
. link:https://www.apple.com/macos/monterey[macOS Monterey] . link:https://www.apple.com/macos/sonoma[macOS Sonoma]
. link:https://developer.apple.com/xcode[Xcode] . link:https://developer.apple.com/xcode[Xcode]
== Setup == Setup
@@ -56,7 +56,7 @@ To install, run:
---- ----
git clone https://github.com/bkuhlmann/mac_os.git git clone https://github.com/bkuhlmann/mac_os.git
cd mac_os cd mac_os
git checkout 15.0.5 git checkout 17.0.0
---- ----
== Usage == Usage
@@ -172,13 +172,13 @@ All executable scripts can be found in the `bin` folder:
* `bin/run` (required): The main script and interface for macOS setup. * `bin/run` (required): The main script and interface for macOS setup.
The `lib` folder provides the base framework for installing, re-installing, and uninstalling The `lib` folder provides the base framework for installing, re-installing, and uninstalling
software. Everything provided via the link:https://www.alchemists.io/projects/mac_os-config[macOS software. Everything provided via the link:https://alchemists.io/projects/mac_os-config[macOS
Config] project is built upon the functions found in the `lib` folder. See the Config] project is built upon the functions found in the `lib` folder. See the
link:https://www.alchemists.io/projects/mac_os-config[macOS Config] project for further details. link:https://alchemists.io/projects/mac_os-config[macOS Config] project for further details.
* `lib/settings.sh`: Defines global settings for software applications, extensions, etc. * `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 * *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 prior to upgrading as you might experience various errors with Apple not being able to detect an
@@ -216,18 +216,18 @@ git clone https://github.com/bkuhlmann/mac_os.git
cd mac_os cd mac_os
---- ----
== link:https://www.alchemists.io/policies/license[License] == link:https://alchemists.io/policies/license[License]
== link:https://www.alchemists.io/policies/security[Security] == link:https://alchemists.io/policies/security[Security]
== link:https://www.alchemists.io/policies/code_of_conduct[Code of Conduct] == link:https://alchemists.io/policies/code_of_conduct[Code of Conduct]
== link:https://www.alchemists.io/policies/contributions[Contributions] == link:https://alchemists.io/policies/contributions[Contributions]
== link:https://www.alchemists.io/projects/mac_os/versions[Versions] == link:https://alchemists.io/projects/mac_os/versions[Versions]
== link:https://www.alchemists.io/community[Community] == link:https://alchemists.io/community[Community]
== Credits == Credits
Engineered by link:https://www.alchemists.io/team/brooke_kuhlmann[Brooke Kuhlmann]. Engineered by link:https://alchemists.io/team/brooke_kuhlmann[Brooke Kuhlmann].

View File

@@ -1,8 +1,9 @@
# frozen_string_literal: true # frozen_string_literal: true
require "git/lint/rake/setup" require "git/lint/rake/register"
require "rubocop/rake_task" require "rubocop/rake_task"
Git::Lint::Rake::Register.call
RuboCop::RakeTask.new RuboCop::RakeTask.new
task default: %i[git_lint rubocop] task default: %i[git_lint rubocop]

View File

@@ -1,5 +1,52 @@
= Versions = Versions
== 17.0.0 (2023-09-28)
* Added Debug gem - Brooke Kuhlmann
* Updated to macOS Sonoma - Brooke Kuhlmann
== 16.0.4 (2023-06-19)
* Updated to Caliber 0.35.0 - Brooke Kuhlmann
* Updated to Git Lint 6.0.0 - Brooke Kuhlmann
* Updated to Refinements 11.0.0 - Brooke Kuhlmann
== 16.0.3 (2023-05-18)
* Updated to Caliber 0.30.0 - Brooke Kuhlmann
== 16.0.2 (2023-04-02)
* Fixed programs without extensions to install to user directory - Brooke Kuhlmann
* Updated site URLs to use bare domain - Brooke Kuhlmann
* Updated to Ruby 3.2.1 - Brooke Kuhlmann
* Updated to Ruby 3.2.2 - Brooke Kuhlmann
== 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) == 15.0.5 (2022-05-07)
* Updated to Caliber 0.6.0 - Brooke Kuhlmann * Updated to Caliber 0.6.0 - Brooke Kuhlmann

View File

@@ -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

View File

@@ -4,19 +4,19 @@
printf "macOS Boot Disk Tips\n" printf "macOS Boot Disk Tips\n"
printf " - Use a USB drive (8GB or higher).\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 " - Use Disk Utility to label the USB drive as \"Untitled\".\n"
printf "\nmacOS Boot Disk Usage:\n" printf "\nmacOS Boot Disk Usage:\n"
printf " 1. Insert the USB boot disk into the machine to be upgraded.\n" printf " 1. Insert the USB boot disk into the machine to be upgraded.\n"
printf " 2. Reboot the machine.\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 " 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 " 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 " 7. Install the new operating system.\n"
printf "\nmacOS Boot Disk Recovery:\n" printf "\nmacOS Boot Disk Recovery:\n"
printf " 1. Start/restart the machine.\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 " 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 " 4. Use the dialog options to launch Disk Utility, reinstall the system, etc.\n"

View File

@@ -1,13 +1,13 @@
#! /usr/bin/env bash #! /usr/bin/env bash
# Applies basic system settings. # Installs basic system settings.
set -o nounset set -o nounset
set -o errexit set -o errexit
set -o pipefail set -o pipefail
IFS=$'\n\t' 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 if [[ -x "$SCRIPT_PATH" ]]; then
"$SCRIPT_PATH" "$SCRIPT_PATH"

View File

@@ -1,13 +1,13 @@
#! /usr/bin/env bash #! /usr/bin/env bash
# Applies default settings. # Installs system and application default settings.
set -o nounset set -o nounset
set -o errexit set -o errexit
set -o pipefail set -o pipefail
IFS=$'\n\t' 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 if [[ -x "$SCRIPT_PATH" ]]; then
"$SCRIPT_PATH" "$SCRIPT_PATH"

View File

@@ -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
View 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
View 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
View File

@@ -4,9 +4,7 @@
source lib/installers.sh source lib/installers.sh
source lib/options.sh source lib/options.sh
source lib/reinstallers.sh
source lib/settings.sh source lib/settings.sh
source lib/uninstallers.sh
source lib/utilities.sh source lib/utilities.sh
source lib/verifiers.sh source lib/verifiers.sh
@@ -32,29 +30,25 @@ while true; do
printf " Boot:\n" printf " Boot:\n"
printf " B: Create boot disk.\n" printf " B: Create boot disk.\n"
printf " Install:\n" printf " Install:\n"
printf " b: Apply basic settings.\n" printf " b: Install basics.\n"
printf " t: Install development tools.\n" printf " t: Install development tools.\n"
printf " hf: Install Homebrew Formulas.\n" printf " hf: Install Homebrew Formulas.\n"
printf " hc: Install Homebrew Casks.\n" printf " hc: Install Homebrew Casks.\n"
printf " m: Install Mac App Store software.\n" printf " m: Install Mac App Store software.\n"
printf " a: Install application software.\n" printf " a: Install application software.\n"
printf " x: Install application software extensions.\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 " np: Install Node packages.\n"
printf " rg: Install Ruby gems.\n" printf " rg: Install Ruby gems.\n"
printf " rc: Install Rust crates.\n" printf " rc: Install Rust crates.\n"
printf " d: Apply default settings.\n" printf " l: Install libraries (i.e. executes all of the above steps in order listed).\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 " Manage:\n" printf " Manage:\n"
printf " c: Check status of managed software.\n" printf " c: Check status of managed software.\n"
printf " C: Caffeinate machine.\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 " w: Clean work (temp) directory.\n"
printf " q: Quit/Exit.\n\n" printf " q: Quit/Exit.\n\n"
read -p "Enter selection: " response read -p "Enter selection: " response

View File

@@ -11,8 +11,16 @@ download_file() {
printf "%s\n" "Downloading $1..." printf "%s\n" "Downloading $1..."
clean_work_path clean_work_path
mkdir $MAC_OS_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"
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 export -f download_file
@@ -193,8 +201,8 @@ export -f install_program
# Installs Node. # Installs Node.
# Parameters: None. # Parameters: None.
install_node() { install_node() {
if ! command -v fnm > /dev/null; then if [[ ! -x "$(command -v node)" ]]; then
$(get_homebrew_bin_root)/fnm install --lts "$(get_homebrew_bin_root)/fnm" install --latest
fi fi
} }
export -f install_node export -f install_node
@@ -205,9 +213,11 @@ install_ruby() {
local version="$(cat $HOME/.ruby-version | tr -d '\n')" local version="$(cat $HOME/.ruby-version | tr -d '\n')"
if [[ ! -x "$(command -v ruby)" && -n $(ruby --version | grep --quiet "$version") ]]; then if [[ ! -x "$(command -v ruby)" && -n $(ruby --version | grep --quiet "$version") ]]; then
$(get_homebrew_bin_root)/frum install "$version" "$(get_homebrew_bin_root)"/frum install "$version" \
$(get_homebrew_bin_root)/frum local "$version" --with-openssl-dir="$(brew --prefix openssl)" \
gem update --system && gem update --enable-shared \
--disable-silent-rules
"$(get_homebrew_bin_root)"/frum local "$version"
fi fi
} }
export -f install_ruby export -f install_ruby

View File

@@ -9,7 +9,7 @@ process_option() {
'B') 'B')
bin/create_boot_disk;; bin/create_boot_disk;;
'b') 'b')
bin/apply_basic_settings;; bin/install_basics;;
't') 't')
bin/install_dev_tools;; bin/install_dev_tools;;
'hf') 'hf')
@@ -22,38 +22,36 @@ process_option() {
bin/install_applications;; bin/install_applications;;
'x') 'x')
bin/install_extensions;; bin/install_extensions;;
'df')
bin/install_dotfiles;;
'np')
bin/install_node_packages;;
'rg')
bin/install_ruby_gems;;
'rc')
bin/install_rust_crates;;
'd') 'd')
bin/apply_default_settings;; bin/install_defaults;;
'cs') 's')
bin/configure_software;; bin/install_shell;;
'r')
bin/restore_backup;;
'i') 'i')
caffeinate_machine caffeinate_machine
bin/apply_basic_settings bin/install_basics
bin/install_dev_tools bin/install_dev_tools
bin/install_homebrew_formulas bin/install_homebrew_formulas
bin/install_homebrew_casks bin/install_homebrew_casks
bin/install_app_store bin/install_app_store
bin/install_applications bin/install_applications
bin/install_extensions 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_node_packages
bin/install_ruby_gems bin/install_ruby_gems
bin/install_rust_crates bin/install_rust_crates;;
bin/apply_default_settings 'c')
bin/configure_software
clean_work_path;;
'R')
caffeinate_machine
bin/restore_backup;;
'c')
verify_homebrew_formulas verify_homebrew_formulas
verify_homebrew_casks verify_homebrew_casks
verify_app_store_applications verify_app_store_applications
@@ -64,14 +62,6 @@ process_option() {
verify_rust_crates;; verify_rust_crates;;
'C') 'C')
caffeinate_machine;; caffeinate_machine;;
'ua')
uninstall_application;;
'ux')
uninstall_extension;;
'ra')
reinstall_application;;
'rx')
reinstall_extension;;
'w') 'w')
clean_work_path;; clean_work_path;;
'q');; 'q');;

View File

@@ -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

View File

@@ -5,7 +5,7 @@ set -o errexit
set -o pipefail set -o pipefail
IFS=$'\n\t' 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 Sonoma.app/Contents/Resources/createinstallmedia"
export MAC_OS_BOOT_DISK_PATH="/Volumes/Untitled" export MAC_OS_BOOT_DISK_PATH="/Volumes/Untitled"
export MAC_OS_WORK_PATH=/tmp/downloads export MAC_OS_WORK_PATH=/tmp/downloads
export MAC_OS_CONFIG_PATH="../mac_os-config" export MAC_OS_CONFIG_PATH="../mac_os-config"

View File

@@ -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

View File

@@ -77,18 +77,10 @@ export -f get_install_path
# Parameters: $1 (required) - The file name. # Parameters: $1 (required) - The file name.
get_install_root() { get_install_root() {
local file_name="$1" local file_name="$1"
local file_extension=$(get_extension "$file_name")
# Special cases not supported by Homebrew. case $(get_extension "$file_name") in
if [[ "$file_name" == "elm" ]]; then
printf "/usr/local/bin"
return
fi
# Dynamically build the install path based on file extension.
case $file_extension in
'') '')
printf "$(get_homebrew_bin_root)";; printf "/usr/local/bin";;
'app') 'app')
printf "/Applications";; printf "/Applications";;
'prefPane') 'prefPane')