Skip to content
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

Allow outer shebangs so justfiles can be used as scripts #393

Merged
merged 7 commits into from
Apr 8, 2019
Merged

Conversation

casey
Copy link
Owner

@casey casey commented Apr 8, 2019

This was long overdue, since it was really just a matter of removing code.

With this change, justfiles can be used as scripts. Just write a justfile with a shebang line on top:

#!/usr/bin/env just --justfile

foo:
  echo foo

and you can do:

$ ./justfile
echo foo
foo

You can use a shebang like this to avoid changing directories:

#!/usr/bin/env just --working-directory ./ --justfile

Fixes #367.

@casey casey merged commit 37639d6 into master Apr 8, 2019
@casey casey deleted the scriptfile branch April 8, 2019 21:28
@casey
Copy link
Owner Author

casey commented Apr 8, 2019

I'm very curious what uses people put this feature to, so do let me know if you wind up using it!

@gl-yziquel
Copy link
Contributor

gl-yziquel commented Jan 19, 2024

I'm using it to make more custom and convenient wrappers around the himalaya command line interface tool for emails. It's extremely convenient to be able to hack around and improve on the user experience of a raw CLI. Makes CLI composable, in some sense.

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.

Executable Justfiles
2 participants