⛩️ 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.

refactor(yae): control logging through silent flag

Fuwn 693a1e8a 090157a0

+9 -20
+7 -17
source.go
··· 20 20 Force bool `json:"force,omitempty"` 21 21 } 22 22 23 - func (source *Source) Update(sources *Sources, name string, show bool, force bool, forcePinned bool) (bool, error) { 24 - if show { 25 - log.Infof("checking %s", name) 26 - } 23 + func (source *Source) Update(sources *Sources, name string, force bool, forcePinned bool) (bool, error) { 24 + log.Infof("checking %s", name) 27 25 28 26 updated := false 29 27 30 28 if !sources.Exists(name) { 31 - if show { 32 - log.Warnf("skipped %s: source does not exist", name) 33 - } 29 + log.Warnf("skipped %s: source does not exist", name) 34 30 35 31 return updated, nil 36 32 } 37 33 38 34 if source.Pinned && !forcePinned { 39 - if show { 40 - log.Infof("skipped %s: source is pinned", name) 41 - } 35 + log.Infof("skipped %s: source is pinned", name) 42 36 43 37 return updated, nil 44 38 } ··· 53 47 } 54 48 55 49 if tag != source.Version || force || source.Force { 56 - if show && tag != source.Version { 50 + if tag != source.Version { 57 51 log.Infof("bumped %s: %s -> %s", name, source.Version, tag) 58 52 } 59 53 ··· 67 61 source.URL = strings.ReplaceAll(source.URLTemplate, "{version}", source.Version) 68 62 } 69 63 } else { 70 - if show { 71 - log.Infof("skipped %s: version remains unchanged", name) 72 - } 64 + log.Infof("skipped %s: version remains unchanged", name) 73 65 74 66 return updated, nil 75 67 } ··· 82 74 } 83 75 84 76 if sha256 != source.SHA256 { 85 - if show { 86 - log.Infof("rehashed %s: %s -> %s", name, source.SHA256, sha256) 87 - } 77 + log.Infof("rehashed %s: %s -> %s", name, source.SHA256, sha256) 88 78 89 79 source.SHA256 = sha256 90 80 updated = true
+2 -3
yae.go
··· 220 220 }, 221 221 }, 222 222 Action: func(c *cli.Context) error { 223 - showAll := !c.Bool("show-updated-only") && !c.Bool("show-updated-only-formatted") 224 223 updates := []string{} 225 224 force := c.Bool("force-hashed") 226 225 forcePinned := c.Bool("force-pinned") 227 226 228 227 if c.Args().Len() == 0 { 229 228 for name, source := range sources { 230 - if updated, err := source.Update(&sources, name, showAll, force, forcePinned); err != nil { 229 + if updated, err := source.Update(&sources, name, force, forcePinned); err != nil { 231 230 return err 232 231 } else if updated { 233 232 updates = append(updates, name) ··· 237 236 name := c.Args().Get(0) 238 237 source := sources[name] 239 238 240 - if updated, err := source.Update(&sources, name, showAll, force, forcePinned); err != nil { 239 + if updated, err := source.Update(&sources, name, force, forcePinned); err != nil { 241 240 return err 242 241 } else if updated { 243 242 updates = append(updates, name)