Firstsawyou commented on a change in pull request #3220:
URL: https://github.com/apache/apisix/pull/3220#discussion_r553800652
##########
File path: Makefile
##########
@@ -83,7 +83,9 @@ init: default
### run: Start the apisix server
.PHONY: run
run: default
-ifeq ("$(wildcard logs/nginx.pid)", "")
+ifeq ("$(findstring /root, ${PWD})", "/root")
+ @echo "Warning! It is forbidden to run APISIX in the /root directory."
Review comment:
updated.
##########
File path: Makefile
##########
@@ -83,7 +83,10 @@ init: default
### run: Start the apisix server
.PHONY: run
run: default
-ifeq ("$(wildcard logs/nginx.pid)", "")
+ifeq ("$(findstring /root, ${PWD})", "/root")
+ @echo "Non-zero exit status: 1"
Review comment:
@spacewander
Updated, please help me to see, is this right?
##########
File path: Makefile
##########
@@ -84,8 +84,8 @@ init: default
.PHONY: run
run: default
ifeq ("$(findstring /root, ${PWD})", "/root")
- @echo "Non-zero exit status: 1"
- @echo "Error, It is forbidden to run APISIX in the /root directory."
+ @echo "Error: It is forbidden to run APISIX in the /root directory."
+ @exit 1
Review comment:
I don't know how to add test cases for Makefile. Can you give me some
suggestions?
##########
File path: Makefile
##########
@@ -84,8 +84,8 @@ init: default
.PHONY: run
run: default
ifeq ("$(findstring /root, ${PWD})", "/root")
- @echo "Non-zero exit status: 1"
- @echo "Error, It is forbidden to run APISIX in the /root directory."
+ @echo "Error: It is forbidden to run APISIX in the /root directory."
+ @exit 1
Review comment:
好的,我知道了。
##########
File path: Makefile
##########
@@ -84,8 +84,8 @@ init: default
.PHONY: run
run: default
ifeq ("$(findstring /root, ${PWD})", "/root")
- @echo "Non-zero exit status: 1"
- @echo "Error, It is forbidden to run APISIX in the /root directory."
+ @echo "Error: It is forbidden to run APISIX in the /root directory."
+ @exit 1
Review comment:
Ok, got it.
##########
File path: Makefile
##########
@@ -83,7 +83,10 @@ init: default
### run: Start the apisix server
.PHONY: run
run: default
-ifeq ("$(wildcard logs/nginx.pid)", "")
+ifeq ("$(findstring /root, ${PWD})", "/root")
Review comment:
Ok, got it.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]