Current section

Files

Jump to
parrot src parrot@config.erl
Raw

src/parrot@config.erl

-module(parrot@config).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([get_json_file/1, get_module_directory/1, get_module_path/1]).
-export_type([config/0]).
-type config() :: {config, binary(), binary()}.
-file("src/parrot/config.gleam", 11).
-spec get_json_file(config()) -> {ok, binary()} |
{error, simplifile:file_error()}.
get_json_file(Config) ->
Path = filepath:join(
parrot@internal@project:root(),
erlang:element(2, Config)
),
simplifile:read(Path).
-file("src/parrot/config.gleam", 16).
-spec get_module_directory(config()) -> binary().
get_module_directory(Config) ->
_pipe = filepath:join(
parrot@internal@project:src(),
erlang:element(3, Config)
),
filepath:directory_name(_pipe).
-file("src/parrot/config.gleam", 21).
-spec get_module_path(config()) -> binary().
get_module_path(Config) ->
filepath:join(parrot@internal@project:src(), erlang:element(3, Config)).