Compare commits

..

5 Commits
8.2.0 ... 9.0.0

Author SHA1 Message Date
Brooke Kuhlmann
5455a76d14 Added version release notes 2020-09-12 10:11:23 -06:00
Brooke Kuhlmann
5569fdb345 Refactored utility basename and extension utilities
Minor cleanup to the method names used for less typing.
2020-09-12 09:58:53 -06:00
Brooke Kuhlmann
8f2173c938 Removed unnecessary verifier code comments
These were not adding much value so are safe to remove.
2020-09-12 09:51:40 -06:00
Brooke Kuhlmann
4f1ed26934 Removed Homebrew Mecurial formula verification check
No longer necessary as Mecurial isn't used or required by any
applications in the macOS Configuration project.
2020-09-12 09:45:27 -06:00
Brooke Kuhlmann
b7c89266f6 Fixed Homebrew cask verifier deprecation warning
Resolves the following warning when using Homebrew 2.5.0:

    Warning: Calling brew cask list is deprecated! Use brew list

Removed conditional checks for the Skitch, Witch, and OpenEmu
applications since they are no longer supported.
2020-09-12 09:45:27 -06:00
5 changed files with 36 additions and 52 deletions

View File

@@ -1,5 +1,12 @@
= Changes = Changes
== 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) == 8.2.0 (2020-07-22)
* Fixed project requirements * Fixed project requirements

View File

@@ -59,7 +59,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 8.2.0 git checkout 9.0.0
---- ----
=== Development === Development

View File

@@ -136,7 +136,7 @@ export -f install_program
# Parameters: $1 (required) - Repository URL, $2 (required) - Install path, $3 (optional) - Git clone options. # Parameters: $1 (required) - Repository URL, $2 (required) - Install path, $3 (optional) - Git clone options.
install_git_app() { install_git_app() {
local repository_url="$1" local repository_url="$1"
local app_name=$(get_file_name "$2") local app_name=$(get_basename "$2")
local install_path="$2" local install_path="$2"
local options="--quiet" local options="--quiet"
@@ -175,7 +175,7 @@ export -f install_git_project
# Parameters: $1 (required) - URL, $2 (required) - Install path. # Parameters: $1 (required) - URL, $2 (required) - Install path.
install_file() { install_file() {
local file_url="$1" local file_url="$1"
local file_name=$(get_file_name "$1") local file_name=$(get_basename "$1")
local install_path="$2" local install_path="$2"
if [[ ! -e "$install_path" ]]; then if [[ ! -e "$install_path" ]]; then
@@ -206,7 +206,7 @@ export -f download_file
# Parameters: $1 (required) - Application source path, $2 (required) - Application name. # Parameters: $1 (required) - Application source path, $2 (required) - Application name.
install_app() { install_app() {
local install_root=$(get_install_root "$2") 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" printf "Installing: $install_root/$2...\n"

View File

@@ -2,6 +2,19 @@
# Defines general utility functions. # 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. # Answers the full install path (including file name) for file name.
# Parameters: $1 (required) - The file name. # Parameters: $1 (required) - The file name.
get_install_path() { get_install_path() {
@@ -17,24 +30,11 @@ clean_work_path() {
} }
export -f 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. # Answers the root install path for file name.
# 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_file_extension "$file_name") local file_extension=$(get_extension "$file_name")
# Dynamically build the install path based on file extension. # Dynamically build the install path based on file extension.
case $file_extension in case $file_extension in
@@ -52,10 +52,17 @@ get_install_root() {
} }
export -f 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. # Answers the file extension.
# Parameters: $1 (required) - The file name. # Parameters: $1 (required) - The file name.
get_file_extension() { get_extension() {
local name=$(get_file_name "$1") local name=$(get_basename "$1")
local extension="${1##*.}" # Excludes dot. local extension="${1##*.}" # Excludes dot.
if [[ "$name" == "$extension" ]]; then if [[ "$name" == "$extension" ]]; then
@@ -64,11 +71,4 @@ get_file_extension() {
printf "$extension" printf "$extension"
fi fi
} }
export -f get_file_extension export -f get_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

View File

@@ -9,7 +9,6 @@ verify_homebrew_formulas() {
local applications="$(brew list)" local applications="$(brew list)"
while read line; do while read line; do
# Skip blank or comment lines.
if [[ "$line" == "brew install"* ]]; then if [[ "$line" == "brew install"* ]]; then
local application=$(printf "$line" | awk '{print $3}') local application=$(printf "$line" | awk '{print $3}')
@@ -18,11 +17,6 @@ verify_homebrew_formulas() {
application="gnupg" application="gnupg"
fi fi
# Exception: "hg" is the binary but is listed as "mercurial".
if [[ "$application" == "hg" ]]; then
application="mercurial"
fi
verify_listed_application "$application" "${applications[*]}" verify_listed_application "$application" "${applications[*]}"
fi fi
done < "$MAC_OS_CONFIG_PATH/bin/install_homebrew_formulas" done < "$MAC_OS_CONFIG_PATH/bin/install_homebrew_formulas"
@@ -35,23 +29,11 @@ export -f verify_homebrew_formulas
verify_homebrew_casks() { verify_homebrew_casks() {
printf "\nChecking Homebrew casks...\n" printf "\nChecking Homebrew casks...\n"
local applications="$(brew cask list)" local applications="$(brew list --cask)"
while read line; do while read line; do
# Skip blank or comment lines.
if [[ "$line" == "brew cask install"* ]]; then if [[ "$line" == "brew cask install"* ]]; then
local application=$(printf "$line" | awk '{print $4}') 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[*]}" verify_listed_application "$application" "${applications[*]}"
fi fi
done < "$MAC_OS_CONFIG_PATH/bin/install_homebrew_casks" done < "$MAC_OS_CONFIG_PATH/bin/install_homebrew_casks"
@@ -67,7 +49,6 @@ verify_app_store_applications() {
local applications="$(mas list)" local applications="$(mas list)"
while read line; do while read line; do
# Skip blank or comment lines.
if [[ "$line" == "mas install"* ]]; then if [[ "$line" == "mas install"* ]]; then
local application=$(printf "$line" | awk '{print $3}') local application=$(printf "$line" | awk '{print $3}')
verify_listed_application "$application" "${applications[*]}" 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 each application name, check to see if the application is installed. Otherwise, skip.
for name in $file_names; do for name in $file_names; do
# Pass the key value to verfication.
verify_application "${!name}" verify_application "${!name}"
done done
@@ -111,8 +91,6 @@ export -f verify_applications
# Parameters: $1 (required) - The file name. # Parameters: $1 (required) - The file name.
verify_application() { verify_application() {
local file_name="$1" local file_name="$1"
# Display the missing install if not found.
local install_path=$(get_install_path "$file_name") local install_path=$(get_install_path "$file_name")
if [[ ! -e "$install_path" ]]; then if [[ ! -e "$install_path" ]]; then
@@ -143,7 +121,6 @@ export -f verify_extensions
verify_path() { verify_path() {
local path="$1" local path="$1"
# Display the missing path if not found.
if [[ ! -e "$path" ]]; then if [[ ! -e "$path" ]]; then
printf " - Missing: $path\n" printf " - Missing: $path\n"
fi fi