Skip to content

Fake Module Convention

Dewayne VanHoozer edited this page Jun 18, 2022 · 1 revision

The author of the just utility is currently designing and implementing a comprehensive module system. Until that new feature set is available we can use what I call a "Fake Module Convention" that can be implemented with the current just version.

This convention can be used without justprep however, the short-hand way in which justprep facilitates the fake module convention is very useful.

The convention in a nut-shell is to add a recipe to your main just file that is the name of your "module" with a single parameter that represents the recipe that you want to run in that module. Here is an example without using the justprep short-hand:

my_mod recipe='list':
  just -f path/to/a/justfile {{recipe}}

From the command line you would execute the recipe the normal way:

just my_mod xyzzy

which will execute the xyzzy recipe defined in the just file specified in the my_mod recipe.

See JUSTPREP_MODULE_KEYWORD for an example of how the justprep short-hand works with this fake module convention.

Clone this wiki locally