add --disable-redis option to build.sh
This commit is contained in:
		
							
								
								
									
										27
									
								
								build.sh
									
									
									
									
									
								
							
							
						
						
									
										27
									
								
								build.sh
									
									
									
									
									
								
							| @@ -1,8 +1,33 @@ | |||||||
| #!/usr/bin/env bash | #!/usr/bin/env bash | ||||||
| set -e | set -e | ||||||
| root=$(readlink -e $(dirname $0)) | root=$(readlink -e $(dirname $0)) | ||||||
|  |  | ||||||
|  | tags="" | ||||||
|  |  | ||||||
|  | help_text="usage: $0 [--disable-redis]" | ||||||
|  |  | ||||||
|  | # check for help flags first | ||||||
|  | for arg in $@ ; do | ||||||
|  |     case $arg in | ||||||
|  |         -h|--help) | ||||||
|  |             echo $help_text | ||||||
|  |             exit 0 | ||||||
|  |             ;; | ||||||
|  |     esac | ||||||
|  | done | ||||||
|  |  | ||||||
|  | # check for build flags | ||||||
|  | for arg in $@ ; do | ||||||
|  |     case $arg in | ||||||
|  |         "--disable-redis") | ||||||
|  |             tags="$tags -tags disable_redis" | ||||||
|  |             ;; | ||||||
|  |     esac | ||||||
|  | done | ||||||
|  |  | ||||||
| cd $root | cd $root | ||||||
| export GOPATH=$root/go | export GOPATH=$root/go | ||||||
| mkdir -p $GOPATH | mkdir -p $GOPATH | ||||||
| go get -v -u github.com/majestrate/srndv2 | go get -v -u $tags github.com/majestrate/srndv2 | ||||||
| cp -a $GOPATH/bin/srndv2 $root | cp -a $GOPATH/bin/srndv2 $root | ||||||
|  | echo "Built" | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user