3 ms·
> One issue with Just is that by default each line in a recipe is executed in a sub shell. Set a variable in line 1 and you can’t use it in line 2. Mise `run` b
by BeetleB 3mo ago
> One issue with Just is that by default each line in a recipe is executed in a sub shell. Set a variable in line 1 and you can’t use it in line 2. Mise `run` blocks are embedded shell scripts.
just supports the same. If you begin a recipe with a shebang (#!/bin/bash), then it dumps the whole recipe to a file and executes it as a shell script.
Not limited to bash - you can do the same with Python, etc.
As for scripts in their own files vs embedded in a justfile: I've noticed people's opinions vary. Even in my team we'd debate the issue. I prefer them in the justfile so I can read them in one place - as long as it's not huge. Some team members preferred them in their own files.
- kstrauser 3mo agoThere was something about the shebang method that made someone else that I wanted to use not work but I forget the details. In any case, just is very nice — I just like mise more at the moment. The own-file bit comes in nice when you want to run them standalone (CI/CD; maybe someone doesn’t want to use the runner) or you’re fighting against escaping rules. I like having them in the mise file when they’re just a couple of lines. If it turns into a full-on thing, then I prefer to extract it. Either way, options are nice.