From 528c9f0e3c5b1bd9db8c2d3529ace556f9fb6bac Mon Sep 17 00:00:00 2001 From: Eric Hanchrow Date: Wed, 30 Oct 2024 15:50:47 -0700 Subject: [PATCH] Document using functions in variable assignments (#2431) --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9d3ab58396..994ec4881c 100644 --- a/README.md +++ b/README.md @@ -1292,19 +1292,19 @@ Available recipes: ### Variables and Substitution -Variables, strings, concatenation, path joining, and substitution using `{{…}}` -are supported: +Variables, strings, concatenation, path joining, substitution using `{{…}}`, and function calls are supported: ```just tmpdir := `mktemp -d` version := "0.2.7" tardir := tmpdir / "awesomesauce-" + version tarball := tardir + ".tar.gz" +config := quote(config_dir() / ".project-config") publish: rm -f {{tarball}} mkdir {{tardir}} - cp README.md *.c {{tardir}} + cp README.md *.c {{ config }} {{tardir}} tar zcvf {{tarball}} {{tardir}} scp {{tarball}} me@server.com:release/ rm -rf {{tarball}} {{tardir}} @@ -1497,8 +1497,8 @@ Done! ### Functions -`just` provides a few built-in functions that might be useful when writing -recipes. +`just` provides many built-in functions for use in expressions, including +recipe body `{{…}}` substitutions, assignments, and default parameter values. All functions ending in `_directory` can be abbreviated to `_dir`. So `home_directory()` can also be written as `home_dir()`. In addition,