This is an automated email from the ASF dual-hosted git repository.

membphis pushed a commit to branch v1.0
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git

commit 8d80f5b93d1aa9d5914cd3c1a0f33d1a23699c24
Author: YuanSheng Wang <[email protected]>
AuthorDate: Tue Jan 7 20:18:25 2020 +0800

    bugfix: use current folder as working space for developer. (#1030)
---
 bin/apisix | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/bin/apisix b/bin/apisix
index b9de45b..5fae3ed 100755
--- a/bin/apisix
+++ b/bin/apisix
@@ -17,7 +17,7 @@
 -- limitations under the License.
 --
 
-local script_path = debug.getinfo(1).source:sub(2)
+local script_path = arg[0]
 
 local function trim(s)
     return (s:gsub("^%s*(.-)%s*$", "%1"))
@@ -38,18 +38,18 @@ end
 excute_cmd("install -d -m 777 /tmp/apisix_cores/")
 
 local apisix_home = "/usr/local/apisix"
-if script_path:sub(1, 17) == '/usr/local/apisix' or script_path:sub(1, 4) == 
'/bin' then
-    package.cpath = "/usr/local/apisix/deps/lib64/lua/5.1/?.so;"
-                    .. "/usr/local/apisix/deps/lib/lua/5.1/?.so;"
-                    .. package.cpath
-
-    package.path  = "/usr/local/apisix/deps/share/lua/5.1/apisix/lua/?.lua;"
-                    .. "/usr/local/apisix/deps/share/lua/5.1/?.lua;"
-                    .. "/usr/share/lua/5.1/apisix/lua/?.lua;"
-                    .. "/usr/local/share/lua/5.1/apisix/lua/?.lua;"
-                    .. package.path
-
-else
+package.cpath = "/usr/local/apisix/deps/lib64/lua/5.1/?.so;"
+                .. "/usr/local/apisix/deps/lib/lua/5.1/?.so;"
+                .. package.cpath
+
+package.path  = "/usr/local/apisix/deps/share/lua/5.1/apisix/lua/?.lua;"
+                .. "/usr/local/apisix/deps/share/lua/5.1/?.lua;"
+                .. "/usr/share/lua/5.1/apisix/lua/?.lua;"
+                .. "/usr/local/share/lua/5.1/apisix/lua/?.lua;"
+                .. package.path
+
+-- only for developer, use current folder as working space
+if script_path:sub(1, 2) == './' then
     apisix_home = pwd
     package.cpath = pwd .. "/deps/lib64/lua/5.1/?.so;"
                     .. package.cpath

Reply via email to