From 14ce4d86a5592cd67704f0b7c7c86877efec3d6f Mon Sep 17 00:00:00 2001 From: Akira Komamura Date: Mon, 2 Dec 2024 21:58:12 +0900 Subject: [PATCH] fix(ocaml): Set the environment in .env file --- ocaml/.env | 4 ++++ ocaml/.envrc | 5 +---- ocaml/justfile | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 ocaml/.env 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