monkeyDluffy6017 commented on code in PR #9846:
URL: https://github.com/apache/apisix/pull/9846#discussion_r1267083941
##########
apisix/cli/ops.lua:
##########
@@ -817,21 +828,25 @@ local function start(env, ...)
local customized_yaml = args["config"]
if customized_yaml then
- profile.apisix_home = env.apisix_home .. "/"
- local local_conf_path = profile:yaml_path("config")
- local local_conf_path_bak = local_conf_path .. ".bak"
+ local customized_config_path
+ local idx = str_find(customized_yaml, "/")
+ if idx and idx == 1 then
+ customized_config_path = customized_yaml
+ else
+ local cur_dir, err = lfs.currentdir()
+ if err then
+ util.die("failed to get current directory")
+ end
+ customized_config_path = cur_dir .. "/" .. customized_yaml
+ end
- local ok, err = os_rename(local_conf_path, local_conf_path_bak)
- if not ok then
- util.die("failed to backup config, error: ", err)
+ if not util.file_exists(customized_config_path) then
+ util.die("customized config file not exists, path: " ..
customized_config_path)
Review Comment:
LGTM
--
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]