aboutsummaryrefslogtreecommitdiff
path: root/yae.go
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-10-11 15:16:17 -0700
committerFuwn <[email protected]>2024-10-11 15:16:21 -0700
commite9e48f2ad4d62ec4953deb2ad189726d7c594b7c (patch)
tree57c6c734b710d3f95f334370a8cacafac783d245 /yae.go
parentd0eaa90dc4172dee11d27b01694b90d0e94027bf (diff)
downloadyae-e9e48f2ad4d62ec4953deb2ad189726d7c594b7c.tar.xz
yae-e9e48f2ad4d62ec4953deb2ad189726d7c594b7c.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 {