diff options
| author | Fuwn <[email protected]> | 2024-10-11 06:08:27 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-10-11 06:08:27 -0700 |
| commit | b665bfadc1ace0acae27942af7f69438fa32b8e3 (patch) | |
| tree | d266cb65aa4181c5658ac9ecccd74a37583cce25 /yae.go | |
| parent | e4182d17bfe5437375b0fa7a3e1e2a5669311097 (diff) | |
| download | yae-b665bfadc1ace0acae27942af7f69438fa32b8e3.tar.xz yae-b665bfadc1ace0acae27942af7f69438fa32b8e3.zip | |
feat(yae): prevent updates with pinning
Diffstat (limited to 'yae.go')
| -rw-r--r-- | yae.go | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -97,6 +97,10 @@ func main() { Name: "trim-tag-prefix", Usage: "A prefix to trim from remote git tags", }, + &cli.BoolFlag{ + Name: "pin", + Usage: "Prevent the source from being updated", + }, }, Action: func(c *cli.Context) error { if c.Args().Len() != 2 { @@ -132,6 +136,10 @@ func main() { source.TrimTagPrefix = c.String("trim-tag-prefix") } + if c.Bool("pin") { + source.Pinned = true + } + if sha256, err := fetchSHA256(source.URI, c.Bool("unpack"), !c.Bool("silent")); err != nil { return err } else { @@ -298,6 +306,14 @@ func updateSource(sources *Sources, name string, source Source, show bool) (bool return updated, fmt.Errorf("source does not exist") } + if source.Pinned { + if show { + fmt.Println("skipped update for", name, "because it is pinned") + } + + return updated, nil + } + if source.Type == "git" { tag, err := fetchLatestGitTag(source, show) |