Skip to content

Commit 25860df

Browse files
committed
build: add switch to build tags
1 parent 6548a95 commit 25860df

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

nginx-build-msys2.sh

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
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
415
machine_str="$(gcc -dumpmachine | cut -d'-' -f1)"
516

@@ -22,10 +33,18 @@ OPENSSL="openssl-1.1.0h"
2233
if [[ -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
2742
else
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
3049
fi
3150
git checkout -b patch

0 commit comments

Comments
 (0)