Skip to content

Resolve cygpath from env JUST_CYGPATH #2804

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jul 6, 2025
Merged

Conversation

hyrious
Copy link
Contributor

@hyrious hyrious commented Jul 5, 2025

I couldn't pass all the tests from my Windows setup because it seems to rely on a real sh program.

I did verify the env works:

> cargo b
> target\debug\just.exe --shell "C:\Program Files\Git\usr\bin\sh.exe" _ruby
Hello from ruby!

...where otherwise it prints:

error: Could not find `cygpath` executable to translate recipe `_ruby` shebang interpreter path:
program not found

Fixes #2641

Copy link
Owner

@casey casey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be done as a command-line option, --cygpath, which also can be set using an environment variable. See config.rs. Command line options show up in --help, so they're a little more discoverable.

@hyrious
Copy link
Contributor Author

hyrious commented Jul 5, 2025

Hi I just added the --cygpath command-line option. I'm using Option<OsString> as the config value, but there's no other config using the same type. It seems that clap does accept this type and my local testing also passes. I'm not sure if it is the prefered way to do this.

@casey
Copy link
Owner

casey commented Jul 5, 2025

Nice. I think it should be a PathBuf, since it could either be just the filename, or an absolute path to the binary.

@hyrious
Copy link
Contributor Author

hyrious commented Jul 5, 2025

Done. I have also tested it locally to verify it works.

casey added 7 commits July 5, 2025 20:03
- Un-hide argument on non-windows
- Give argument a default value
- Pass config instead of path
@casey casey merged commit 014491d into casey:master Jul 6, 2025
6 checks passed
@casey
Copy link
Owner

casey commented Jul 6, 2025

Nice, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Search cygpath.exe from Git's install path
2 participants