aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/luarocks/util.lua11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/luarocks/util.lua b/src/luarocks/util.lua
index 7f7ad80f..2d44c189 100644
--- a/src/luarocks/util.lua
+++ b/src/luarocks/util.lua
@@ -352,7 +352,16 @@ function util.this_program(default)
352 cur = dbg.source 352 cur = dbg.source
353 i=i+1 353 i=i+1
354 end 354 end
355 return last:sub(1,1) == "@" and last:sub(2) or last 355 local prog = last:sub(1,1) == "@" and last:sub(2) or last
356
357 -- Check if we found the true path of a script that has a wrapper
358 local lrdir, binpath = prog:match("^(.*)/lib/luarocks/rocks%-[0-9.]*/[^/]+/[^/]+(/bin/[^/]+)$")
359 if lrdir then
360 -- Return the wrapper instead
361 return lrdir .. binpath
362 end
363
364 return prog
356end 365end
357 366
358function util.deps_mode_help(program) 367function util.deps_mode_help(program)