Skip to content

Commit

Permalink
Moved duplicate priv-dir code from other projects to here.
Browse files Browse the repository at this point in the history
  • Loading branch information
oubiwann committed Jan 12, 2025
1 parent 16d90a3 commit b145d03
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions src/lutil-file.lfe
Original file line number Diff line number Diff line change
Expand Up @@ -275,3 +275,17 @@
(lists:filter
#'lutil:check/1
(funcall func beams)))

(defun priv (app priv-rel-path)
(filename:join (code:priv_dir app)
priv-rel-path))

(defun read-priv (app priv-rel-path)
(case (file:read_file (priv app priv-rel-path))
(`#(ok ,data) data)
(err err)))

(defun read-priv-config (app priv-rel-path)
(case (file:consult (priv app priv-rel-path))
(`#(ok (,terms)) terms)
(err err)))
2 changes: 1 addition & 1 deletion src/lutil.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{description, "LFE Utility Functions and Macros"},

%% The version of the application
{vsn, "0.16.1"},
{vsn, "0.16.2"},

%% All modules used by the application.
{modules, [
Expand Down

0 comments on commit b145d03

Please sign in to comment.