spacewander commented on code in PR #6980:
URL: https://github.com/apache/apisix/pull/6980#discussion_r864784053


##########
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

Review Comment:
   We can use `if not pl_path.exists`? The `exists` will return the input 
argument back if it exists, so there is no need to reassign it back.



##########
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"

Review Comment:
   Using name `logs_path` would be better?



-- 
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]

Reply via email to