⛩️ 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): use charmbracelet/log for logging

Fuwn c5eb4397 3ab40ae6

+50 -9
+12
go.mod
··· 5 5 require github.com/urfave/cli/v2 v2.27.4 6 6 7 7 require ( 8 + github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect 9 + github.com/charmbracelet/lipgloss v0.10.0 // indirect 10 + github.com/charmbracelet/log v0.4.0 // indirect 8 11 github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect 12 + github.com/go-logfmt/logfmt v0.6.0 // indirect 13 + github.com/lucasb-eyer/go-colorful v1.2.0 // indirect 14 + github.com/mattn/go-isatty v0.0.18 // indirect 15 + github.com/mattn/go-runewidth v0.0.15 // indirect 16 + github.com/muesli/reflow v0.3.0 // indirect 17 + github.com/muesli/termenv v0.15.2 // indirect 18 + github.com/rivo/uniseg v0.4.7 // indirect 9 19 github.com/russross/blackfriday/v2 v2.1.0 // indirect 10 20 github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect 21 + golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect 22 + golang.org/x/sys v0.13.0 // indirect 11 23 )
+28
go.sum
··· 1 + github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= 2 + github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= 3 + github.com/charmbracelet/lipgloss v0.10.0 h1:KWeXFSexGcfahHX+54URiZGkBFazf70JNMtwg/AFW3s= 4 + github.com/charmbracelet/lipgloss v0.10.0/go.mod h1:Wig9DSfvANsxqkRsqj6x87irdy123SR4dOXlKa91ciE= 5 + github.com/charmbracelet/log v0.4.0 h1:G9bQAcx8rWA2T3pWvx7YtPTPwgqpk7D68BX21IRW8ZM= 6 + github.com/charmbracelet/log v0.4.0/go.mod h1:63bXt/djrizTec0l11H20t8FDSvA4CRZJ1KH22MdptM= 1 7 github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= 2 8 github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= 9 + github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= 10 + github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= 11 + github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= 12 + github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= 13 + github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98= 14 + github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= 15 + github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= 16 + github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= 17 + github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= 18 + github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s= 19 + github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKtnHY/8= 20 + github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo= 21 + github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8= 22 + github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= 23 + github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= 24 + github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= 25 + github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= 3 26 github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= 4 27 github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= 5 28 github.com/urfave/cli/v2 v2.27.4 h1:o1owoI+02Eb+K107p27wEX9Bb8eqIoZCfLXloLUSWJ8= 6 29 github.com/urfave/cli/v2 v2.27.4/go.mod h1:m4QzxcD2qpra4z7WhzEGn74WZLViBnMpb1ToCAKdGRQ= 7 30 github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4= 8 31 github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM= 32 + golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI= 33 + golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= 34 + golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 35 + golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= 36 + golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+7 -5
source.go
··· 3 3 import ( 4 4 "fmt" 5 5 "strings" 6 + 7 + "github.com/charmbracelet/log" 6 8 ) 7 9 8 10 type Source struct { ··· 27 29 28 30 if source.Pinned && !forcePinned { 29 31 if show { 30 - fmt.Println("skipped update for", name, "because it is pinned") 32 + log.Infof("skipped %s: source is pinned", name) 31 33 } 32 34 33 35 return updated, nil ··· 41 43 } 42 44 43 45 if tag != source.Version || force || source.Force { 44 - if show { 45 - fmt.Println("updated version for", name, "from", source.Version, "to", tag) 46 + if show && tag != source.Version { 47 + log.Infof("bumped %s: %s -> %s", name, source.Version, tag) 46 48 } 47 49 48 50 if tag != source.Version { ··· 56 58 } 57 59 } else { 58 60 if show { 59 - fmt.Println("skipped update for", name, "because the version is unchanged") 61 + log.Infof("skipped %s: version remains unchanged", name) 60 62 } 61 63 62 64 return updated, nil ··· 71 73 72 74 if sha256 != source.SHA256 { 73 75 if show { 74 - fmt.Println("updated hash for", name, "from", source.SHA256, "to", sha256) 76 + log.Infof("rehashed %s: %s -> %s", name, source.SHA256, sha256) 75 77 } 76 78 77 79 source.SHA256 = sha256
+3 -4
yae.go
··· 6 6 "strings" 7 7 "time" 8 8 9 + "github.com/charmbracelet/log" 9 10 "github.com/urfave/cli/v2" 10 11 ) 11 12 ··· 40 41 Copyright: fmt.Sprintf("Copyright (c) 2024-%s Fuwn", fmt.Sprint(time.Now().Year())), 41 42 ExitErrHandler: func(c *cli.Context, err error) { 42 43 if err != nil { 43 - fmt.Println(err) 44 - os.Exit(1) 44 + log.Fatal(err.Error()) 45 45 } 46 46 }, 47 47 Suggest: true, ··· 249 249 }, 250 250 }, 251 251 }).Run(os.Args); err != nil { 252 - fmt.Println(err) 253 - os.Exit(1) 252 + log.Fatal(err.Error()) 254 253 } 255 254 }