⛩️ Powerful yet Minimal Nix Dependency Manager
flake flakes home-manager nixos go nix dependency dependencies
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(yae): force pinned updates flag

Fuwn ea99abe0 0f60ae6d

+10 -5
+10 -5
yae.go
··· 187 187 }, 188 188 &cli.BoolFlag{ 189 189 Name: "force-hashed", 190 - Usage: "Force updates to non-pinned sources that have an unchanged version (recalculate hash)", 190 + Usage: "Force updates for non-pinned sources that have an unchanged version (recalculate hash)", 191 + }, 192 + &cli.BoolFlag{ 193 + Name: "force-pinned", 194 + Usage: "Force updates for all sources, including pinned sources (can be used with --force-hashed)", 191 195 }, 192 196 }, 193 197 Action: func(c *cli.Context) error { 194 198 showAll := !c.Bool("show-updated-only") && !c.Bool("show-updated-only-formatted") 195 199 updates := []string{} 196 200 force := c.Bool("force-hashed") 201 + forcePinned := c.Bool("force-pinned") 197 202 198 203 if c.Args().Len() == 0 { 199 204 for name, value := range sources { 200 - if updated, err := updateSource(&sources, name, value, showAll, force); err != nil { 205 + if updated, err := updateSource(&sources, name, value, showAll, force, forcePinned); err != nil { 201 206 return err 202 207 } else if updated { 203 208 updates = append(updates, name) ··· 206 211 } else { 207 212 name := c.Args().Get(0) 208 213 209 - if updated, err := updateSource(&sources, name, sources[name], showAll, force); err != nil { 214 + if updated, err := updateSource(&sources, name, sources[name], showAll, force, forcePinned); err != nil { 210 215 return err 211 216 } else if updated { 212 217 updates = append(updates, name) ··· 306 311 return "", fmt.Errorf("source is not a git repository") 307 312 } 308 313 309 - func updateSource(sources *Sources, name string, source Source, show bool, force bool) (bool, error) { 314 + func updateSource(sources *Sources, name string, source Source, show bool, force bool, forcePinned bool) (bool, error) { 310 315 updated := false 311 316 312 317 if !sources.Exists(name) { 313 318 return updated, fmt.Errorf("source does not exist") 314 319 } 315 320 316 - if source.Pinned { 321 + if source.Pinned && !forcePinned { 317 322 if show { 318 323 fmt.Println("skipped update for", name, "because it is pinned") 319 324 }