File tree Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
22
3+ # cmd line switches
4+ for i in " $@ "
5+ do
6+ case $i in
7+ -t=* |--tag=* )
8+ NGINX_TAG=" ${i#* =} "
9+ shift # past argument=value
10+ ;;
11+ esac
12+ done
13+
314# init
415machine_str=" $( gcc -dumpmachine | cut -d' -' -f1) "
516
@@ -22,10 +33,18 @@ OPENSSL="openssl-1.1.0h"
2233if [[ -d nginx ]]; then
2334 cd nginx
2435 git checkout master
25- git reset --hard origin || git reset --hard
26- git pull
36+ if [[ " ${NGINX_TAG} " == " " ]]; then
37+ git reset --hard origin || git reset --hard
38+ git pull
39+ else
40+ git reset --hard " ${NGINX_TAG} " || git reset --hard
41+ fi
2742else
28- git clone https://github.com/nginx/nginx.git --depth=1 --config http.sslVerify=false
43+ if [[ " ${NGINX_TAG} " == " " ]]; then
44+ git clone https://github.com/nginx/nginx.git --depth=1
45+ else
46+ git clone https://github.com/nginx/nginx.git --depth=1 --branch " ${NGINX_TAG} "
47+ fi
2948 cd nginx
3049fi
3150git checkout -b patch
You can’t perform that action at this time.
0 commit comments