wolfe-labs / DU-LuaC

👨‍💻 Lua command-line utility for Dual Universe Lua projects
https://www.npmjs.com/package/@wolfe-labs/du-luac
BSD 3-Clause "New" or "Revised" License
16 stars 14 forks source link

embedFile(): use same file resolving method as require() #30

Closed tobitege closed 9 months ago

tobitege commented 9 months ago

The compiler uses the LUA_PATH for resolving filenames for the require() command. However, the embedFile() only seems to try to find the file in the same directory where called from. It would be helpful and consistent if embedFile would use the same filename resolving mechanism as e.g. renderscripts could be located in their own location.

Looked in the source for it: In src/compiler_functions.ts -> export default class LibraryEmbedFileFunction -> invoke should equally use "getRequiredFileInfo()" method (in DULuaCompiler.ts)

matpratta commented 9 months ago

Fixed in 2ad91041f23158f1316dd20ec7f123db2df4618e