Created
July 24, 2016 14:26
-
-
Save Asmageddon/553a96c36438ddc915e44ffaf952b594 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rawrequire = require | |
function require(path) | |
if string.sub(path, 1,1) == "." then | |
local root = (debug.getinfo(2, 'S')).source:sub(2); | |
root = root:gsub("/[^/]*$", ""):gsub("/", ".") | |
return rawrequire(root .. path) | |
else | |
return rawrequire(path) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment