You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using just 1.28.0 (installed from cargo) with a setup like this:
$ tree -a
.
├── a
│ └── a.justfile
├── .custom-env
└── justfile
1 directory, 3 files
.custom-env
$ cat .custom-env
HELLO_WORLD="hello world"
justfile
$ cat justfile
set dotenv-load := true
set dotenv-path := ".custom-env"
mod a "a/a.justfile"
help:
@just --list --justfile {{ justfile() }}
a/a.justfile
$ cat a/a.justfile
set dotenv-load := true
set dotenv-path := "../.custom-env"
export MY_VAR := env_var("HELLO_WORLD")
help:
@just --list a --justfile {{ justfile() }}
task:
@echo $MY_VAR
This works as expected from the "root" directory:
$ just
Available recipes:
help
a ...
$ just a
Available recipes:
help
task
$ just a task
hello world
However, if I cd into the a directory, my .custom-env file is no longer detected:
$ cd a
$ just
Available recipes:
help
a ...
$ just a
error: Call to function `env_var` failed: environment variable `HELLO_WORLD` not present
——▶ a/a.justfile:4:18
│
4 │ export MY_VAR := env_var("HELLO_WORLD")
│ ^^^^^^^
$ just a task
error: Call to function `env_var` failed: environment variable `HELLO_WORLD` not present
——▶ a/a.justfile:4:18
│
4 │ export MY_VAR := env_var("HELLO_WORLD")
│
Note that things work fine if I rename my .custom-env file to .env (no other code changes):
$ mv ../.custom-env ../.env
$ just
Available recipes:
help
a ...
$ just a
Available recipes:
help
task
$ just a task
hello world
The text was updated successfully, but these errors were encountered:
Nice catch! This is actually unrelated to submodules, I was testing if a dotenv-path file existed without first making it relative to the current working directory, so it wouldn't be found if you were running just from a subdirectory, regardless of whether it's a submodule. Fixed in #2152.
I'm using just 1.28.0 (installed from cargo) with a setup like this:
.custom-env
justfile
a/a.justfile
This works as expected from the "root" directory:
However, if I cd into the
a
directory, my.custom-env
file is no longer detected:Note that things work fine if I rename my
.custom-env
file to.env
(no other code changes):The text was updated successfully, but these errors were encountered: