From ca83865ca47fa5e079064e8c624a4284313aa52b Mon Sep 17 00:00:00 2001 From: Fuwn Date: Fri, 11 Oct 2024 22:16:17 +0000 Subject: feat(yae): force add flag --- yae.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/yae.go b/yae.go index 7749b2a..a592a29 100644 --- a/yae.go +++ b/yae.go @@ -101,6 +101,10 @@ func main() { Name: "pin", Usage: "Prevent the source from being updated", }, + &cli.BoolFlag{ + Name: "force", + Usage: "Always force update the source, regardless of unchanged remote tag", + }, }, Action: func(c *cli.Context) error { if c.Args().Len() != 2 { @@ -140,6 +144,14 @@ func main() { source.Pinned = true } + if c.Bool("force") { + if source.Pinned { + return fmt.Errorf("cannot set a source to be statically forced and pinned at the same time") + } + + source.Force = true + } + if sha256, err := fetchSHA256(source.URL, c.Bool("unpack"), !c.Bool("silent")); err != nil { return err } else { -- cgit v1.2.3