Adapt for running from escript (fix).
This commit is contained in:
@@ -110,6 +110,18 @@ get_priv_dir() ->
|
||||
Dir
|
||||
end.
|
||||
|
||||
%% @private
|
||||
is_escript() ->
|
||||
case erlang:function_exported(escript, script_name, 0) of
|
||||
true ->
|
||||
try
|
||||
{true, filename:absname(escript:script_name())}
|
||||
catch
|
||||
_:_ -> false
|
||||
end;
|
||||
false -> false
|
||||
end.
|
||||
|
||||
%% @doc Open the specified sqlite3 database.
|
||||
%% It is possible to use sqlite's uri filenames to open files.
|
||||
%% See: [https://sqlite.org/uri.html] for more information.
|
||||
|
||||
Reference in New Issue
Block a user