Skip to content

Commit

Permalink
v1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
programminglaboratorys committed Nov 28, 2024
1 parent ebd9083 commit 3215713
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
get xlua and clickteam sdk to be able to compile the library
than open sln file and setup project properties
8 changes: 7 additions & 1 deletion fs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static int listdir(lua_State* L) { // listdir(path: string, type: integer) -> ta

int index = 1; // start from 1
if (!(fs::is_directory(dir_path))) {
return luaL_error(L, "expected a vaild dir path (got", dir_path, ")");
return luaL_error(L, "expected a vaild dir path (got %s)", dir_path);
}
lua_newtable(L);
for (const auto& entry : fs::directory_iterator(dir_path)) {
Expand All @@ -55,6 +55,12 @@ static int listdir(lua_State* L) { // listdir(path: string, type: integer) -> ta
return 1;
}

static int get_cwd(lua_State* L) { // get_cwd() -> string
lua_pushstring(L, fs::current_path().string().c_str());
return 1;
}


static inline void registerCfunction(lua_State* L, lua_CFunction func, const char* name, int stack = -2) {
int base = lua_gettop(L);
if (base <= 0)
Expand Down

0 comments on commit 3215713

Please sign in to comment.