Skip to content

Make assignment evaluation lazy #953

@tomprince

Description

@tomprince

I'd like to be able to define variables with backtick substitutions that are only run if the variable is referenced (I'd be fine if all the variables used in any commands are run before any of the commands run).

The use case I have is having a justfile that runs in multiple contexts, and some of the backtick substitutions can only be run in one of the contexts:

nix_volume_path := `podman volume inspect --format '{{.Mountpoint}}' nix`

build:
    podman exec nix just /src/_build

_build
   nix build ...

where the podman volume inspect does not succeed in the inner context.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions