浏览代码

minor fix for initial installs and build tools

Kyle P Davis 8 年之前
父节点
当前提交
ca59d6cecb
共有 2 个文件被更改,包括 25 次插入1 次删除
  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