Reading justfiles from stdin
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.
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 https://github.com/casey/just/pull/1933 for adding proper support
@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.
I really do not like the idea of having the folder switched to
/devwhen using/dev/stdinas a Justfile...
Yeah, me neither. Although there is also this option as a workaround:
$ echo 'a:
> pwd' | just -d . -f /dev/stdin
I really do not like the idea of having the folder switched to
/devwhen using/dev/stdinas a Justfile...Yeah, me neither. Although there is also this option as a workaround:
$ echo 'a: > pwd' | just -d . -f /dev/stdin
Pretty cool.
/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.