Adapt for running from escript (fix 7).

This commit is contained in:
Anton Makarov
2025-09-10 15:37:16 +03:00
parent 25bccc2562
commit 143745d61b

View File

@@ -112,7 +112,7 @@ try_escript() ->
RootDir = filename:dirname(filename:dirname(Pref)), RootDir = filename:dirname(filename:dirname(Pref)),
AppsDir = filename:join(RootDir, "lib"), AppsDir = filename:join(RootDir, "lib"),
io:format("AppsDir = ~p~n", [AppsDir]), io:format("AppsDir = ~p~n", [AppsDir]),
filename:join([AppsDir, [$.|Suf], "priv"]); % prepend "." to suffix that starts with "/" filename:join(AppsDir, [$.|Suf]); % prepend "." to suffix that starts with "/"
false -> false ->
case code:priv_dir(esqlite) of case code:priv_dir(esqlite) of
{error, bad_name} -> "priv"; {error, bad_name} -> "priv";