casey / casey/just

executable_directory fails on Windows

Open
#2,741 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
Rust
Stars
35.8k
Forks
846
Avg merge
27m
Merged PRs (30d)
3

Description

I get the following error when trying to run one of my cross-platform justfiles on Windows:

```bash
just mise::install
error: Call to function `executable_directory` failed: executable directory not found
——▶ justfile-mise.just:25:17

25 │ mise_bin_dir := executable_directory()
│ ^^^^^^^^^^^^^^^^^^^^
error: Recipe `_update-mise` failed on line 21 with exit code 1
```

This is to be expected, since the underlying crate that provides that functionality indicates that it has no windows equivalent: https://docs.rs/dirs/latest/dirs/fn.executable_dir.html

My experience with the built-in just functions are very positive, and I hardly ever have to worry about whether a specific function is going to cause issues for developers on other platforms, so I was surprised when this issue occurred.

I can't think of a good solution to this issue, but perhaps it can be helpful to mention in the documentation that this specific function does not work on Windows.

As a side note, perhaps there can be a kind of "lint" command for just, that can report whether you are using functions in your justfiles that are known to not be "portable".

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.