aboutsummaryrefslogtreecommitdiff
path: root/yae.go
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-10-11 22:16:17 +0000
committerFuwn <[email protected]>2024-10-11 22:16:21 +0000
commitca83865ca47fa5e079064e8c624a4284313aa52b (patch)
tree57c6c734b710d3f95f334370a8cacafac783d245 /yae.go
parentfeat(yae): allow statically forceable sources (diff)
downloadyae-ca83865ca47fa5e079064e8c624a4284313aa52b.tar.xz
yae-ca83865ca47fa5e079064e8c624a4284313aa52b.zip
feat(yae): force add flag
Diffstat (limited to 'yae.go')
-rw-r--r--yae.go12
1 files changed, 12 insertions, 0 deletions
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 {