Skip to content

Add variable to have just require a program to be present on the system #2334

@nogweii

Description

@nogweii

As a command runner, it would be convenient to be able to specify the list of programs necessary for my Justfile to run. Something like the following example:

set required-programs := ["kubectl", "helm", "helmfile"]

bootstrap: && helm-charts
    kubectl apply -f foo.yaml

helm-charts:
    helmfile apply --file bar.yaml

status:
    helm ls -A

And if I didn't have those programs installed, just would error out before running a recipe with a helpful message saying that I need to install, say, helm & helmfile.

If this is added, I can imagine a need for [require-optional] (with a better name though) if people wanted to provide a recipe to install all the missing programs.

This is basically automatically doing #2109 and reporting an error. If that function is added, this could be solved by creating a recipe that does this. However, I still think it's worthwhile to include this feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions