Explorar o código

minor fix for initial installs and build tools

Kyle P Davis %!s(int64=9) %!d(string=hai) anos
pai
achega
ca59d6cecb
Modificáronse 2 ficheiros con 25 adicións e 1 borrados
  1. 17 0
      gimme
  2. 8 1
      gimmes/gcc

+ 17 - 0
gimme

@@ -47,6 +47,23 @@ if [[ "$0" =~ [-]?bash ]]; then # sourced or piped
 
 
 		set -o errexit -o pipefail
 		set -o errexit -o pipefail
 
 
+		# gimmes/gcc: inlined for curl-based installs
+		if [[ "$OS" = "Darwin" ]]; then
+			if ! "xcode-select" --version &>/dev/null; then
+				echo "Try again after installing the Xcode command-line tools by running:  xcode-select --install"
+				exit 1
+			fi
+			if ! xcodebuild -help &>/dev/null; then
+				echo "Try again after agreeing to the Xcode license by running:  sudo xcodebuild -license"
+				exit 1
+			fi
+		else
+			has gcc  ||  gimme_pkg build-essential
+		fi
+
+		# gimmes/git: inlined for curl-based installs
+		has git  ||  gimme_pkg git
+
 		if ! [[ -d "$GIMME_DIR" ]]; then
 		if ! [[ -d "$GIMME_DIR" ]]; then
 
 
 			echo "Installing $GIMME_DIR/gimme ..."
 			echo "Installing $GIMME_DIR/gimme ..."

+ 8 - 1
gimmes/gcc

@@ -2,7 +2,14 @@
 set -o errexit -o pipefail
 set -o errexit -o pipefail
 if [[ "$OS" = "Darwin" ]]; then
 if [[ "$OS" = "Darwin" ]]; then
 	set +o pipefail
 	set +o pipefail
-	"xcode-select" --install 2>&1 | grep -q "already installed"
+	if ! "xcode-select" --version &>/dev/null; then
+		echo "Try again after installing the Xcode command-line tools by running:  xcode-select --install"
+		exit 1
+	fi
+	if ! xcodebuild -help &>/dev/null; then
+		echo "Try again after agreeing to the Xcode license by running:  sudo xcodebuild -license"
+		exit 1
+	fi
 else
 else
 	has gcc  ||  gimme_pkg build-essential
 	has gcc  ||  gimme_pkg build-essential
 fi
 fi