spacewander commented on a change in pull request #5171:
URL: https://github.com/apache/apisix/pull/5171#discussion_r723822935
##########
File path: apisix/cli/ops.lua
##########
@@ -891,6 +891,44 @@ local function cleanup()
end
+local function test(env, backup_ngx_conf)
+ -- backup nginx.conf
+ local ngx_conf_path = env.apisix_home .. "/conf/nginx.conf"
+ local ngx_conf_exist = io_open(ngx_conf_path)
+ if ngx_conf_exist then
+ local err = util.execute_cmd_with_error("mv " .. ngx_conf_path .. " "
Review comment:
We can use `os.rename`.
##########
File path: apisix/cli/ops.lua
##########
@@ -891,6 +891,44 @@ local function cleanup()
end
+local function test(env, backup_ngx_conf)
+ -- backup nginx.conf
+ local ngx_conf_path = env.apisix_home .. "/conf/nginx.conf"
+ local ngx_conf_exist = io_open(ngx_conf_path)
Review comment:
We can use `util.is_file_exist`?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]