From b8ccbc49efccf0452f32fea6881f7b91d9be0dae Mon Sep 17 00:00:00 2001 From: xonix Date: Tue, 11 Jan 2022 23:00:06 +0200 Subject: [PATCH] Allow `@define` after goals #95 : README.md --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 60475fb..07b95b4 100644 --- a/README.md +++ b/README.md @@ -171,8 +171,6 @@ By default `makesure` logs the goals being executed. Use this option if this is ### @define -Only valid: in prelude. - Use this directive to declare global variable (visible to all goals). The variable will be declared as environment variable (via `export`). @@ -183,6 +181,10 @@ Example: @define B="${A} world" ``` +This directive is valid [in any place](tests/24_define_everywhere.sh) in `Makesurefile`. However, we recommend: +- place frequently changed variables (like versions) to the top of `Makesurefile` +- place infrequently changed variables closer to the goals/libs that use them + Variable defined with `@define` can be overridden with a variable passed in invocation via `-D` parameter. Overall the precedence for variables resolution is (higher priority top):