mirror of
https://github.com/lazuscripts/locator.git
synced 2024-11-19 10:54:24 +00:00
locator returns last err encountered while searching for a require
This commit is contained in:
parent
13dfb4c149
commit
25e4ed91f5
@ -6,6 +6,7 @@ import insert, sort from table
|
|||||||
-- if a path is specified, it will be checked before other paths
|
-- if a path is specified, it will be checked before other paths
|
||||||
-- checks the project root, then each path specified in locator_config
|
-- checks the project root, then each path specified in locator_config
|
||||||
locate = (name, path) ->
|
locate = (name, path) ->
|
||||||
|
local value
|
||||||
print "locate ->"
|
print "locate ->"
|
||||||
if path
|
if path
|
||||||
print "try '#{path}.#{name}'"
|
print "try '#{path}.#{name}'"
|
||||||
@ -26,9 +27,9 @@ locate = (name, path) ->
|
|||||||
return value if ok
|
return value if ok
|
||||||
|
|
||||||
if path
|
if path
|
||||||
error "locator could not find '#{path}.#{name}'"
|
error "locator could not find '#{path}.#{name}'\nlast error: #{value}"
|
||||||
else
|
else
|
||||||
error "locator could not find '#{name}'"
|
error "locator could not find '#{name}'\nlast error: #{value}"
|
||||||
|
|
||||||
-- works like Lapis's autoload, but
|
-- works like Lapis's autoload, but
|
||||||
-- includes trying sub-application paths & can be called to access a value
|
-- includes trying sub-application paths & can be called to access a value
|
||||||
|
Loading…
Reference in New Issue
Block a user