Skip to content

Commit c462bb5

Browse files
committed
luabridge: a new sdm.path() key: appconfigdir
1 parent ab7eac8 commit c462bb5

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/doc/manual/manual.tex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -918,6 +918,7 @@ \subsection{\expr{sdm} global object}
918918
\begin{itemize}
919919
\item \luaexpr{"currentdir"}: current directory;
920920
\item \luaexpr{"homedir"}: home directory of the current user;
921+
\item \luaexpr{"appconfigdir"}: SDM framework configuration directory;
921922
\item \luaexpr{"currentscript"}: a path to the currently executed script, or \luaexpr{nil} if it cannot be obtained;
922923
\item \luaexpr{"currentscriptdir"}: a path to the directory containing the currently executed script, or \luaexpr{nil} if it cannot be obtained;
923924
\item \luaexpr{"program"}: a path to the host program executable (e.g. \shellcmd{sdmhost} or \shellcmd{sdmconsole});

src/luabridge/src/luabridge.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,9 @@ int LuaBridge::LuaMethod_path(LuaServer &lua) {
304304
else if(arg=="homedir") {
305305
lua.pushValue(Path::home().str());
306306
}
307+
else if(arg=="appconfigdir") {
308+
lua.pushValue(Config::appConfigDir().str());
309+
}
307310
else if(arg=="currentscript"||arg=="currentscriptdir") {
308311
auto const &chunkName=lua.currentChunkName();
309312
if(chunkName.empty()||chunkName[0]!='@') lua.pushValue(LuaValue());

0 commit comments

Comments
 (0)