Skip to content

Error: Global justfile not found #2687

@malikoth

Description

@malikoth

just cannot find my global justfile. I believe this behavior is specific to macOS, as the same exact dotfile configuration works just fine in WSL on Windows, as well as in Ubuntu docker containers. My belief, based on this comment is that the dirs library just uses to find XDG directories explicitly ignores user specified environment variables like XDG_CONFIG_HOME.

Steps to reproduce

  1. Be in a shell on macOS
  2. Set a custom directory in the environment variable called XDG_CONFIG_HOME, like /Users/malikoth/.nonstandard_config_dir
  3. Place a justfile in a standard location relative to that non-standard XDG directory, such as /Users/malikoth/.nonstandard_config_dir/just/justfile
  4. Run just --global-justfile

Expected behavior

Due to the path matching the first example given in the docs, $XDG_CONFIG_HOME/just/justfile, the _default recipe in the global justfile should be executed.

Actual Behavior

Just emits the error message error: Global justfile not found and fails with a non-zero error code.

Demonstrative samples from my command line

❯ uname -v
Darwin Kernel Version 21.6.0: Mon Jun 24 00:56:10 PDT 2024; root:xnu-8020.240.18.709.2~1/RELEASE_X86_64

❯ echo $XDG_CONFIG_HOME
/Users/malikoth/.local/etc

❯ la ~/.local/etc/just
total 4.0K
-rw-r--r-- 1 malikoth staff 2.3K Mar 28 21:30 justfile

❯ just -g
error: Global justfile not found

Side Note (Just me complaining, lol)

(Why is .local used for most home directory stuff, except for config files? Why stuff those into ~/.config? That's never made sense to me! .local to me represents the user-scoped equivalent of all the directories in a Unix filesystem root, including etc, so I move it all into .local/etc. I have a shell init script explicitly setting all XDG_* env vars, and another script dedicated exclusively to setting env vars to "help" the apps that need a little more assistance dealing with that fact, but it's not too bad.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions