3 次代碼提交 6a1d60c852 ... 26f132d0a1

作者 SHA1 備註 提交日期
  Kyle P Davis 26f132d0a1 fix: make gimme a little more zsh friendly 5 年之前
  Kyle P Davis 1bc7be7ca3 feat: update python and add python2 specifically 5 年之前
  Kyle P Davis c0a08289f1 feat: update go script to 1.13 5 年之前
共有 4 個文件被更改,包括 12 次插入6 次删除
  1. 7 3
      gimme
  2. 2 2
      gimmes/go
  3. 0 1
      gimmes/python
  4. 3 0
      gimmes/python2

+ 7 - 3
gimme

@@ -26,7 +26,7 @@ has() {
 	if [[ "$FORCE" ]] && echo " $INIT_GIMMES " | grep -q " $1 "; then
 	if [[ "$FORCE" ]] && echo " $INIT_GIMMES " | grep -q " $1 "; then
 		false
 		false
 	else
 	else
-		which "$1" >/dev/null
+		command -v "$1" >/dev/null
 	fi
 	fi
 }
 }
 
 
@@ -72,9 +72,13 @@ gimme_pkg() {
 	fi
 	fi
 }
 }
 
 
-if [[ "$0" =~ [-]?bash ]]; then # sourced or piped
+if [[ "$ZSH_VERSION" ]]; then
+	setopt posixargzero
+fi
+
+if [[ "$0" =~ -?(z|ba)sh ]]; then # sourced or piped
 
 
-	if [[ "${BASH_SOURCE[@]}" ]]; then # sourced
+	if [[ "$ZSH_EVAL_CONTEXT" =~ :file$ || "${BASH_SOURCE[*]}" ]]; then # sourced
 
 
 		# if 'gimme' is not Add gimme to the PATH if not already found
 		# if 'gimme' is not Add gimme to the PATH if not already found
 		if ! [[ "$PATH" == *"$GIMME_DIR"* ]]; then
 		if ! [[ "$PATH" == *"$GIMME_DIR"* ]]; then

+ 2 - 2
gimmes/go

@@ -3,7 +3,7 @@ set -o errexit -o pipefail
 
 
 [[ "$GOROOT" ]]  ||  export GOROOT="$HOME/golang"
 [[ "$GOROOT" ]]  ||  export GOROOT="$HOME/golang"
 [[ "$GOPATH" ]]  ||  export GOPATH="$HOME/go"
 [[ "$GOPATH" ]]  ||  export GOPATH="$HOME/go"
-PKG_VER="1.9"
+PKG_VER="1.13"
 
 
 gimme \
 gimme \
 	curl \
 	curl \
@@ -14,7 +14,7 @@ gimme \
 if ! has go; then
 if ! has go; then
 	if [[ "$OS" = "Darwin" ]]; then
 	if [[ "$OS" = "Darwin" ]]; then
 
 
-		GOROOT="" gimme_pkg go --with-cc-common
+		GOROOT="" gimme_pkg go
 
 
 	else
 	else
 
 

+ 0 - 1
gimmes/python

@@ -1,4 +1,3 @@
 #!/bin/bash
 #!/bin/bash
 set -o errexit -o pipefail
 set -o errexit -o pipefail
 has python  ||  gimme_pkg python
 has python  ||  gimme_pkg python
-has easy_install || gimme_pkg python-setuptools

+ 3 - 0
gimmes/python2

@@ -0,0 +1,3 @@
+#!/bin/bash
+set -o errexit -o pipefail
+has python2  ||  gimme_pkg python2