diff --git a/ocaml/.env b/ocaml/.env new file mode 100644 index 0000000..51602f0 --- /dev/null +++ b/ocaml/.env @@ -0,0 +1,4 @@ +# The default cache path is immutable when odig is installed using Nix +ODIG_CACHE_DIR="$PWD/_build/default/.odig" +# Using _build directory may not be properly allowed for storing user contents +SHERLODOC_DB="$PWD/_build/default/.sherlodoc.marshal" diff --git a/ocaml/.envrc b/ocaml/.envrc index 3112cd7..3b11770 100644 --- a/ocaml/.envrc +++ b/ocaml/.envrc @@ -1,5 +1,2 @@ use flake - -# Using _build directory may not be properly allowed for storing user contents -export ODIG_CACHE_DIR="$(pwd)/_build/default/.odig" -export SHERLODOC_DB="$(pwd)/_build/default/.sherlodoc.marshal" +dotenv diff --git a/ocaml/justfile b/ocaml/justfile index e736a19..02aea0a 100644 --- a/ocaml/justfile +++ b/ocaml/justfile @@ -2,7 +2,7 @@ odig-odoc: odig odoc sherlodoc-index: odig-odoc - find "$(odig cache path)/odoc" -name '*.odocl' \ + find "${ODIG_CACHE_DIR}/odoc" -name '*.odocl' \ | grep -v '__' \ | xargs sherlodoc index