diff options
-rw-r--r-- | src/luarocks/util.lua | 11 |
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 | ||
356 | end | 365 | end |
357 | 366 | ||
358 | function util.deps_mode_help(program) | 367 | function util.deps_mode_help(program) |