diff options
author | sanine <sanine.not@pm.me> | 2022-01-04 15:57:34 -0600 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2022-01-04 15:57:34 -0600 |
commit | 9beef6bdace1e70b5f3097896a955892e324800a (patch) | |
tree | e80bdff3e83e2c5811b410f242eb35317a744edb /src/bindings.c | |
parent | a79dd1526c11e268bd5356bf5388f9a833023c51 (diff) |
implement plugins directory
Diffstat (limited to 'src/bindings.c')
-rw-r--r-- | src/bindings.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/bindings.c b/src/bindings.c index 7a94020..45abf6a 100644 --- a/src/bindings.c +++ b/src/bindings.c @@ -86,6 +86,17 @@ int markdown(lua_State *L) /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +int current_working_directory(lua_State *L) +{ + char *cwd = getcwd(NULL, 0); + lua_pushstring(L, cwd); + free(cwd); + return 1; +} + + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + static void throw_directory_error(lua_State *L, char *dir_name); static struct dirent *read_dir(lua_State *L, DIR *directory); |