diff options
| author | Fuwn <[email protected]> | 2024-10-11 15:16:17 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-10-11 15:16:21 -0700 |
| commit | e9e48f2ad4d62ec4953deb2ad189726d7c594b7c (patch) | |
| tree | 57c6c734b710d3f95f334370a8cacafac783d245 /yae.go | |
| parent | d0eaa90dc4172dee11d27b01694b90d0e94027bf (diff) | |
| download | yae-e9e48f2ad4d62ec4953deb2ad189726d7c594b7c.tar.xz yae-e9e48f2ad4d62ec4953deb2ad189726d7c594b7c.zip | |
feat(yae): force add flag
Diffstat (limited to 'yae.go')
| -rw-r--r-- | yae.go | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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 { |