From aafb6c7188b93301b56acf6d6e1804894db1cd87 Mon Sep 17 00:00:00 2001 From: Brian Zalewski <59970525+ProfessorManhattan@users.noreply.github.com> Date: Mon, 13 Nov 2023 05:20:10 +0000 Subject: [PATCH] Latest --- scripts/cloudflared-ssh.sh | 9 ++++++++- scripts/partials/basic-deps | 9 ++++++++- scripts/provision.sh | 9 ++++++++- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/scripts/cloudflared-ssh.sh b/scripts/cloudflared-ssh.sh index 396fd772..b832dd99 100644 --- a/scripts/cloudflared-ssh.sh +++ b/scripts/cloudflared-ssh.sh @@ -129,7 +129,14 @@ if ! command -v curl > /dev/null || ! command -v git > /dev/null || ! command -v logg info 'Running apk add curl expect git rsync' && apk add curl expect git rsync elif [ -d /Applications ] && [ -d /Library ]; then ### macOS - logg info 'Running sudo xcode-select -p >/dev/null 2>&1 || xcode-select --install' && sudo xcode-select -p >/dev/null 2>&1 || xcode-select --install + logg info "Ensuring Xcode Command Line Tools are installed.." + if ! xcode-select -p >/dev/null 2>&1; then + logg info "Command Line Tools for Xcode not found" + ### This temporary file prompts the 'softwareupdate' utility to list the Command Line Tools + touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress; + XCODE_PKG="$(softwareupdate -l | grep "\*.*Command Line" | tail -n 1 | sed 's/^[^C]* //')" + logg info "Installing from softwareupdate" && softwareupdate -i "$XCODE_PKG" && logg success "Successfully installed $XCODE_PKG" + fi elif [[ "$OSTYPE" == 'cygwin' ]] || [[ "$OSTYPE" == 'msys' ]] || [[ "$OSTYPE" == 'win32' ]]; then ### Windows logg info 'Running choco install -y curl expect git rsync' && choco install -y curl expect git rsync diff --git a/scripts/partials/basic-deps b/scripts/partials/basic-deps index 14fe2b64..2b610677 100644 --- a/scripts/partials/basic-deps +++ b/scripts/partials/basic-deps @@ -21,7 +21,14 @@ if ! command -v curl > /dev/null || ! command -v git > /dev/null || ! command -v logg info 'Running apk add curl expect git rsync' && apk add curl expect git rsync elif [ -d /Applications ] && [ -d /Library ]; then ### macOS - logg info 'Running sudo xcode-select -p >/dev/null 2>&1 || xcode-select --install' && sudo xcode-select -p >/dev/null 2>&1 || xcode-select --install + logg info "Ensuring Xcode Command Line Tools are installed.." + if ! xcode-select -p >/dev/null 2>&1; then + logg info "Command Line Tools for Xcode not found" + ### This temporary file prompts the 'softwareupdate' utility to list the Command Line Tools + touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress; + XCODE_PKG="$(softwareupdate -l | grep "\*.*Command Line" | tail -n 1 | sed 's/^[^C]* //')" + logg info "Installing from softwareupdate" && softwareupdate -i "$XCODE_PKG" && logg success "Successfully installed $XCODE_PKG" + fi elif [[ "$OSTYPE" == 'cygwin' ]] || [[ "$OSTYPE" == 'msys' ]] || [[ "$OSTYPE" == 'win32' ]]; then ### Windows logg info 'Running choco install -y curl expect git rsync' && choco install -y curl expect git rsync diff --git a/scripts/provision.sh b/scripts/provision.sh index 12b3bcc2..bee19366 100644 --- a/scripts/provision.sh +++ b/scripts/provision.sh @@ -163,7 +163,14 @@ ensureBasicDeps() { logg info 'Running apk add curl expect git rsync' && apk add curl expect git rsync elif [ -d /Applications ] && [ -d /Library ]; then ### macOS - logg info 'Running sudo xcode-select -p >/dev/null 2>&1 || xcode-select --install' && sudo xcode-select -p >/dev/null 2>&1 || xcode-select --install + logg info "Ensuring Xcode Command Line Tools are installed.." + if ! xcode-select -p >/dev/null 2>&1; then + logg info "Command Line Tools for Xcode not found" + ### This temporary file prompts the 'softwareupdate' utility to list the Command Line Tools + touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress; + XCODE_PKG="$(softwareupdate -l | grep "\*.*Command Line" | tail -n 1 | sed 's/^[^C]* //')" + logg info "Installing from softwareupdate" && softwareupdate -i "$XCODE_PKG" && logg success "Successfully installed $XCODE_PKG" + fi elif [[ "$OSTYPE" == 'cygwin' ]] || [[ "$OSTYPE" == 'msys' ]] || [[ "$OSTYPE" == 'win32' ]]; then ### Windows logg info 'Running choco install -y curl expect git rsync' && choco install -y curl expect git rsync