From e1b8f40addcbd559ab6afe3c5846efdedda7e75d Mon Sep 17 00:00:00 2001 From: Ophestra Date: Thu, 19 Feb 2026 15:32:25 +0900 Subject: [PATCH] cmd/mbf: cache dir via environment This is much less cumbersome than dragging the flag around all the time. Signed-off-by: Ophestra --- cmd/mbf/main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/mbf/main.go b/cmd/mbf/main.go index ee00465..017f45c 100644 --- a/cmd/mbf/main.go +++ b/cmd/mbf/main.go @@ -59,6 +59,11 @@ func main() { c := command.New(os.Stderr, log.Printf, "mbf", func([]string) (err error) { msg.SwapVerbose(!flagQuiet) + flagBase = os.ExpandEnv(flagBase) + if flagBase == "" { + flagBase = "cache" + } + var base *check.Absolute if flagBase, err = filepath.Abs(flagBase); err != nil { return @@ -85,7 +90,7 @@ func main() { "Maximum number of dependencies to cure at any given time", ).Flag( &flagBase, - "d", command.StringFlag("cache"), + "d", command.StringFlag("$MBF_CACHE_DIR"), "Directory to store cured artifacts", ).Flag( &flagTShift,