Browse Source

minor fix for initial installs and build tools

Kyle P Davis 8 years ago
parent
commit
ca59d6cecb
2 changed files with 25 additions and 1 deletions
  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
 
+		# 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
 
 			echo "Installing $GIMME_DIR/gimme ..."

+ 8 - 1
gimmes/gcc

@@ -2,7 +2,14 @@
 set -o errexit -o pipefail
 if [[ "$OS" = "Darwin" ]]; then
 	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
 	has gcc  ||  gimme_pkg build-essential
 fi