From 92ce8b980974b0ff10b5f105305981414442e1fb Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sun, 2 Oct 2022 21:11:01 +0100 Subject: [PATCH] Updates .macos to call mac config scripts --- system-specific/macos/.macos | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/system-specific/macos/.macos b/system-specific/macos/.macos index 2776039..92bf1c3 100755 --- a/system-specific/macos/.macos +++ b/system-specific/macos/.macos @@ -1,11 +1,28 @@ #!/usr/bin/env bash -# ~/.macos - -DIR="$(cd "$(dirname "$0")" && pwd)/system-settings" - -$DIR/macos-security.sh -$DIR/macos-preferences.sh -$DIR/macos-apps.sh +######################################################################## +# Initiates the applying of MacOS-specific settings and preferences # +# Will use local files if available, otherwise run directly from git # +# IMPORTANT: Be sure to read files through thoughouly before executing # +######################################################################## +# Licensed under MIT (C) Alicia Sykes 2022 # +######################################################################## +macos_scripts=( + "macos-security.sh" # Applies security settings + "macos-preferences.sh" # Sets user preferences + "macos-apps.sh" # Configures app options +) +if [ ! -z $0 ]; then # Use local files + DIR="$(cd "$(dirname "$0")" && pwd)/system-settings" + for mac_script in ${macos_scripts[@]}; do + $DIR/$mac_script + done +else # Run from remote origin + REMOTE_DIR="https://raw.githubusercontent.com/Lissy93/dotfiles" + REMOTE_DIR+="/master/system-specific/macos/system-settings" + for mac_script in ${macos_scripts[@]}; do + bash <(curl -s "${REMOTE_DIR}/${mac_script}") + done +fi