Skip to content

Commit 51e75c0

Browse files
authored
fix: env.lua should use absolute path (#6761)
1 parent e40197c commit 51e75c0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

apisix/cli/env.lua

+8-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,14 @@ return function (apisix_home, pkg_cpath_org, pkg_path_org)
7878
end
7979
end
8080

81-
local openresty_args = [[openresty -p ]] .. apisix_home .. [[ -c ]]
81+
-- pre-transform openresty path
82+
res, err = util.execute_cmd("command -v openresty")
83+
if not res then
84+
error("failed to exec ulimit cmd \'command -v openresty\', err: " .. err)
85+
end
86+
local openresty_path_abs = util.trim(res)
87+
88+
local openresty_args = openresty_path_abs .. [[ -p ]] .. apisix_home .. [[ -c ]]
8289
.. apisix_home .. [[/conf/nginx.conf]]
8390

8491
local min_etcd_version = "3.4.0"

0 commit comments

Comments
 (0)