mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-07-06 13:11:18 -07:00
Make LUA scripting work even if proxmark3 is called from arbitrary working directory
- add @gpakosz whereami library (https://github.com/gpakosz/whereami) in order to ... - determine and set absolute paths for LUA scripts and LUA libraries
This commit is contained in:
parent
4c16ae80f0
commit
4197a3f6ff
8 changed files with 782 additions and 8 deletions
|
@ -536,7 +536,11 @@ int set_pm3_libraries(lua_State *L)
|
|||
|
||||
//-- Last but not least, add to the LUA_PATH (package.path in lua)
|
||||
// so we can load libraries from the ./lualib/ - directory
|
||||
setLuaPath(L,"./lualibs/?.lua");
|
||||
char libraries_path[strlen(get_my_executable_directory()) + strlen(LUA_LIBRARIES_DIRECTORY) + strlen(LUA_LIBRARIES_WILDCARD) + 1];
|
||||
strcpy(libraries_path, get_my_executable_directory());
|
||||
strcat(libraries_path, LUA_LIBRARIES_DIRECTORY);
|
||||
strcat(libraries_path, LUA_LIBRARIES_WILDCARD);
|
||||
setLuaPath(L, libraries_path);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue