Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
45a6c5d1b0 | ||
|
|
1bb6ef39a5 | ||
|
|
1416aa2f0a | ||
|
|
b6cddae599 | ||
|
|
e533bf04be | ||
|
|
5455a76d14 | ||
|
|
5569fdb345 | ||
|
|
8f2173c938 | ||
|
|
4f1ed26934 | ||
|
|
b7c89266f6 |
@@ -1 +1 @@
|
||||
2.7.1
|
||||
2.7.2
|
||||
|
||||
14
CHANGES.adoc
14
CHANGES.adoc
@@ -1,5 +1,19 @@
|
||||
= Changes
|
||||
|
||||
== 10.0.0 (2020-11-15)
|
||||
|
||||
* Added macOS Big Sur support
|
||||
* Updated project documentation to conform to Rubysmith template
|
||||
* Updated to Git Lint 1.3.0
|
||||
* Updated to Ruby 2.7.2
|
||||
|
||||
== 9.0.0 (2020-09-12)
|
||||
|
||||
* Fixed Homebrew cask verifier deprecation warning
|
||||
* Removed Homebrew Mecurial formula verification check
|
||||
* Removed unnecessary verifier code comments
|
||||
* Refactored utility basename and extension utilities
|
||||
|
||||
== 8.2.0 (2020-07-22)
|
||||
|
||||
* Fixed project requirements
|
||||
|
||||
@@ -51,7 +51,8 @@ an appointed representative at an online or offline event.
|
||||
== Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community
|
||||
leaders responsible for enforcement at link:mailto:brooke@alchemists.io?subject=Conduct[Alchemists].
|
||||
leaders responsible for enforcement at link:mailto:brooke@alchemists.io?subject=Conduct[Brooke Kuhlmann].
|
||||
|
||||
All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
All community leaders are obligated to respect the privacy and security of the reporter of any
|
||||
@@ -102,7 +103,7 @@ disparagement of classes of individuals.
|
||||
|
||||
This Code of Conduct is adapted from the
|
||||
link:https://www.contributor-covenant.org/version/2/0/code_of_conduct.html[Contributor Covenant,
|
||||
version 2.0].
|
||||
Version 2.0].
|
||||
|
||||
Community Impact Guidelines were inspired by link:https://github.com/mozilla/diversity[Mozilla's
|
||||
code of conduct enforcement ladder].
|
||||
|
||||
2
Gemfile
2
Gemfile
@@ -3,4 +3,4 @@
|
||||
source "https://rubygems.org"
|
||||
|
||||
gem "rake", "~> 13.0"
|
||||
gem "git-lint", "~> 1.0"
|
||||
gem "git-lint", "~> 1.3"
|
||||
|
||||
@@ -150,7 +150,7 @@ additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
Copyright link:https://www.alchemists.io[Alchemists].
|
||||
Copyright 2016 link:https://www.alchemists.io/team/brooke_kuhlmann[Brooke Kuhlmann].
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
|
||||
compliance with the License. You may obtain a link:https://www.apache.org/licenses/LICENSE-2.0[copy]
|
||||
|
||||
26
README.adoc
26
README.adoc
@@ -46,30 +46,18 @@ image::https://www.alchemists.io/images/screencasts/mac_os/cover.svg[Screencast,
|
||||
|
||||
== Requirements
|
||||
|
||||
. link:https://www.apple.com/macos/catalina[macOS]
|
||||
. link:https://www.apple.com/macos/big-sur[macOS Big Sur]
|
||||
. link:https://developer.apple.com/xcode[Xcode]
|
||||
|
||||
== Setup
|
||||
|
||||
=== Production
|
||||
|
||||
To install, run:
|
||||
|
||||
[source,bash]
|
||||
----
|
||||
git clone https://github.com/bkuhlmann/mac_os.git
|
||||
cd mac_os
|
||||
git checkout 8.2.0
|
||||
----
|
||||
|
||||
=== Development
|
||||
|
||||
To contribute, run:
|
||||
|
||||
[source,bash]
|
||||
----
|
||||
git clone https://github.com/bkuhlmann/mac_os.git
|
||||
cd mac_os
|
||||
git checkout 10.0.0
|
||||
----
|
||||
|
||||
== Usage
|
||||
@@ -221,6 +209,16 @@ link:https://www.alchemists.io/projects/mac_os-config[macOS Config] project for
|
||||
your system, the version might differ, so look for a `*.pkg` in the
|
||||
`/Library/Developer/CommandLineTools/Packages` folder.
|
||||
|
||||
== Development
|
||||
|
||||
To contribute, run:
|
||||
|
||||
[source,bash]
|
||||
----
|
||||
git clone https://github.com/bkuhlmann/mac_os.git
|
||||
cd mac_os
|
||||
----
|
||||
|
||||
== Versioning
|
||||
|
||||
Read link:https://semver.org[Semantic Versioning] for details. Briefly, it means:
|
||||
|
||||
@@ -136,7 +136,7 @@ export -f install_program
|
||||
# Parameters: $1 (required) - Repository URL, $2 (required) - Install path, $3 (optional) - Git clone options.
|
||||
install_git_app() {
|
||||
local repository_url="$1"
|
||||
local app_name=$(get_file_name "$2")
|
||||
local app_name=$(get_basename "$2")
|
||||
local install_path="$2"
|
||||
local options="--quiet"
|
||||
|
||||
@@ -175,7 +175,7 @@ export -f install_git_project
|
||||
# Parameters: $1 (required) - URL, $2 (required) - Install path.
|
||||
install_file() {
|
||||
local file_url="$1"
|
||||
local file_name=$(get_file_name "$1")
|
||||
local file_name=$(get_basename "$1")
|
||||
local install_path="$2"
|
||||
|
||||
if [[ ! -e "$install_path" ]]; then
|
||||
@@ -206,7 +206,7 @@ export -f download_file
|
||||
# Parameters: $1 (required) - Application source path, $2 (required) - Application name.
|
||||
install_app() {
|
||||
local install_root=$(get_install_root "$2")
|
||||
local file_extension=$(get_file_extension "$2")
|
||||
local file_extension=$(get_extension "$2")
|
||||
|
||||
printf "Installing: $install_root/$2...\n"
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ set -o errexit
|
||||
set -o pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
export MAC_OS_BOOT_DISK_CREATOR="/Applications/Install macOS Catalina.app/Contents/Resources/createinstallmedia"
|
||||
export MAC_OS_BOOT_DISK_CREATOR="/Applications/Install macOS Big Sur.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"
|
||||
|
||||
@@ -2,6 +2,19 @@
|
||||
|
||||
# Defines general utility functions.
|
||||
|
||||
# Caffeinate machine.
|
||||
caffeinate_machine() {
|
||||
local pid=$(pgrep -x caffeinate)
|
||||
|
||||
if [[ -n "$pid" ]]; then
|
||||
printf "Machine is already caffeinated!\n"
|
||||
else
|
||||
caffeinate -s -u -d -i -t 3153600000 > /dev/null &
|
||||
printf "Machine caffeinated.\n"
|
||||
fi
|
||||
}
|
||||
export -f caffeinate_machine
|
||||
|
||||
# Answers the full install path (including file name) for file name.
|
||||
# Parameters: $1 (required) - The file name.
|
||||
get_install_path() {
|
||||
@@ -17,24 +30,11 @@ clean_work_path() {
|
||||
}
|
||||
export -f clean_work_path
|
||||
|
||||
# Caffeinate machine.
|
||||
caffeinate_machine() {
|
||||
local pid=$(pgrep -x caffeinate)
|
||||
|
||||
if [[ -n "$pid" ]]; then
|
||||
printf "Whoa, tweaker, machine is already caffeinated!\n"
|
||||
else
|
||||
caffeinate -s -u -d -i -t 3153600000 > /dev/null &
|
||||
printf "Machine caffeinated.\n"
|
||||
fi
|
||||
}
|
||||
export -f caffeinate_machine
|
||||
|
||||
# Answers the root install path for file name.
|
||||
# Parameters: $1 (required) - The file name.
|
||||
get_install_root() {
|
||||
local file_name="$1"
|
||||
local file_extension=$(get_file_extension "$file_name")
|
||||
local file_extension=$(get_extension "$file_name")
|
||||
|
||||
# Dynamically build the install path based on file extension.
|
||||
case $file_extension in
|
||||
@@ -52,10 +52,17 @@ get_install_root() {
|
||||
}
|
||||
export -f get_install_root
|
||||
|
||||
# Answers the file or directory basename.
|
||||
# Parameters: $1 (required) - The file path.
|
||||
get_basename() {
|
||||
printf "${1##*/}" # Answers file or directory name.
|
||||
}
|
||||
export -f get_basename
|
||||
|
||||
# Answers the file extension.
|
||||
# Parameters: $1 (required) - The file name.
|
||||
get_file_extension() {
|
||||
local name=$(get_file_name "$1")
|
||||
get_extension() {
|
||||
local name=$(get_basename "$1")
|
||||
local extension="${1##*.}" # Excludes dot.
|
||||
|
||||
if [[ "$name" == "$extension" ]]; then
|
||||
@@ -64,11 +71,4 @@ get_file_extension() {
|
||||
printf "$extension"
|
||||
fi
|
||||
}
|
||||
export -f get_file_extension
|
||||
|
||||
# Answers the file name.
|
||||
# Parameters: $1 (required) - The file path.
|
||||
get_file_name() {
|
||||
printf "${1##*/}" # Answers file or directory name.
|
||||
}
|
||||
export -f get_file_name
|
||||
export -f get_extension
|
||||
|
||||
@@ -9,7 +9,6 @@ verify_homebrew_formulas() {
|
||||
local applications="$(brew list)"
|
||||
|
||||
while read line; do
|
||||
# Skip blank or comment lines.
|
||||
if [[ "$line" == "brew install"* ]]; then
|
||||
local application=$(printf "$line" | awk '{print $3}')
|
||||
|
||||
@@ -18,11 +17,6 @@ verify_homebrew_formulas() {
|
||||
application="gnupg"
|
||||
fi
|
||||
|
||||
# Exception: "hg" is the binary but is listed as "mercurial".
|
||||
if [[ "$application" == "hg" ]]; then
|
||||
application="mercurial"
|
||||
fi
|
||||
|
||||
verify_listed_application "$application" "${applications[*]}"
|
||||
fi
|
||||
done < "$MAC_OS_CONFIG_PATH/bin/install_homebrew_formulas"
|
||||
@@ -35,23 +29,11 @@ export -f verify_homebrew_formulas
|
||||
verify_homebrew_casks() {
|
||||
printf "\nChecking Homebrew casks...\n"
|
||||
|
||||
local applications="$(brew cask list)"
|
||||
local applications="$(brew list --cask)"
|
||||
|
||||
while read line; do
|
||||
# Skip blank or comment lines.
|
||||
if [[ "$line" == "brew cask install"* ]]; then
|
||||
local application=$(printf "$line" | awk '{print $4}')
|
||||
|
||||
# Skip: Only necessary for the purpose of licensing system preference.
|
||||
if [[ "$application" == "witch" ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
# Skip: Bug with Homebrew Cask as these apps never show up as installed.
|
||||
if [[ "$application" == "skitch" || "$application" == "openemu" ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
verify_listed_application "$application" "${applications[*]}"
|
||||
fi
|
||||
done < "$MAC_OS_CONFIG_PATH/bin/install_homebrew_casks"
|
||||
@@ -67,7 +49,6 @@ verify_app_store_applications() {
|
||||
local applications="$(mas list)"
|
||||
|
||||
while read line; do
|
||||
# Skip blank or comment lines.
|
||||
if [[ "$line" == "mas install"* ]]; then
|
||||
local application=$(printf "$line" | awk '{print $3}')
|
||||
verify_listed_application "$application" "${applications[*]}"
|
||||
@@ -99,7 +80,6 @@ verify_applications() {
|
||||
|
||||
# For each application name, check to see if the application is installed. Otherwise, skip.
|
||||
for name in $file_names; do
|
||||
# Pass the key value to verfication.
|
||||
verify_application "${!name}"
|
||||
done
|
||||
|
||||
@@ -111,8 +91,6 @@ export -f verify_applications
|
||||
# Parameters: $1 (required) - The file name.
|
||||
verify_application() {
|
||||
local file_name="$1"
|
||||
|
||||
# Display the missing install if not found.
|
||||
local install_path=$(get_install_path "$file_name")
|
||||
|
||||
if [[ ! -e "$install_path" ]]; then
|
||||
@@ -143,7 +121,6 @@ export -f verify_extensions
|
||||
verify_path() {
|
||||
local path="$1"
|
||||
|
||||
# Display the missing path if not found.
|
||||
if [[ ! -e "$path" ]]; then
|
||||
printf " - Missing: $path\n"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user