spacewander commented on code in PR #6980:
URL: https://github.com/apache/apisix/pull/6980#discussion_r864787713
##########
apisix/cli/ops.lua:
##########
@@ -713,8 +713,16 @@ local function start(env, ...)
util.die("Error: It is forbidden to run APISIX in the /root
directory.\n")
end
- local cmd_logs = "mkdir -p " .. env.apisix_home .. "/logs"
- util.execute_cmd(cmd_logs)
+ local logs = env.apisix_home .. "/logs"
+ local logs_path = pl_path.exists(logs)
+ if not logs_path then
+ local _, err = pl_path.mkdir(logs)
+ if err ~= nil then
+ util.die("failed to mkdir" .. logs .. ", error: ", err)
Review Comment:
```suggestion
util.die("failed to mkdir " .. logs .. ", error: ", err)
```
--
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]