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

Reading justfiles from stdin #2206

Open
gl-yziquel opened this issue Jun 29, 2024 · 5 comments
Open

Reading justfiles from stdin #2206

gl-yziquel opened this issue Jun 29, 2024 · 5 comments

Comments

@gl-yziquel
Copy link
Contributor

Hi.

As I'd like to declare just fragments remotely and get them executed locally, I'd like to be able to fetch them via curl and get them piped into just. Doesn't seem to currently be possible.

Something like just --sdtin would be nice.

@laniakea64
Copy link
Contributor

It is possible:

$ echo 'foo:
>   echo foo
> 
> bar:
>   echo bar' | just -f /dev/stdin
echo foo
foo

But note that this method uses /dev as working directory:

$ echo 'a:
>   pwd' | just -f /dev/stdin
pwd
/dev

There is #1933 for adding proper support

@gl-yziquel
Copy link
Contributor Author

gl-yziquel commented Jun 29, 2024

@laniakea64 I thought about this. Unfortunately, I really do not like the idea of having the folder switched to /dev when using /dev/stdin as a Justfile...

For now, I worked around it with a temporary file. But I also do not like it at all.

@laniakea64
Copy link
Contributor

I really do not like the idea of having the folder switched to /dev when using /dev/stdin as a Justfile...

Yeah, me neither. Although there is also this option as a workaround:

$ echo 'a:
>   pwd' | just -d . -f /dev/stdin

@gl-yziquel
Copy link
Contributor Author

I really do not like the idea of having the folder switched to /dev when using /dev/stdin as a Justfile...

Yeah, me neither. Although there is also this option as a workaround:

$ echo 'a:
>   pwd' | just -d . -f /dev/stdin

Pretty cool.

@casey
Copy link
Owner

casey commented Jun 29, 2024

/dev/stdin is a great workaround, but it doesn't work on Windows, and it should probably be easier, so I'm going to reopen this.

#1933 is currently open to implement this.

@casey casey reopened this Jun 29, 2024
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

No branches or pull requests

3 participants