diff --git a/main.go b/main.go index f4045c2..59717e5 100644 --- a/main.go +++ b/main.go @@ -126,6 +126,14 @@ func main() { }, } + lazygitCmd := &cobra.Command{ + Use: tools.Lazygit, + Short: "Simple terminal UI for git commands", + Run: func(cmd *cobra.Command, args []string) { + run(tools.Lazygit) + }, + } + ripgrepCmd := &cobra.Command{ Use: tools.Ripgrep, Short: "Recursively searches directories for a regex pattern", @@ -188,6 +196,7 @@ func main() { rootCmd.AddCommand(flyctlCmd) rootCmd.AddCommand(k9sCmd) rootCmd.AddCommand(kubectxCmd) + rootCmd.AddCommand(lazygitCmd) rootCmd.AddCommand(ripgrepCmd) rootCmd.AddCommand(shellcheckCmd) rootCmd.AddCommand(upxCmd) diff --git a/tools/asset.go b/tools/asset.go index cf36eca..31c11e4 100644 --- a/tools/asset.go +++ b/tools/asset.go @@ -37,6 +37,10 @@ func (t *Tool) AssetKubectx() { t.Asset.Name = fmt.Sprintf("kubectx_%v_%v_%v.tar.gz", t.Version, t.OS, t.Arch) } +func (t *Tool) AssetLazygit() { + t.Asset.Name = fmt.Sprintf("lazygit_%v_%v_%v.tar.gz", t.TrimVersion(), t.OS, t.Arch) +} + func (t *Tool) AssetRipgrep() { baseName := fmt.Sprintf("ripgrep-%v-%v-%v", t.Version, t.Arch, t.OS) t.Asset.Name = baseName + ".tar.gz" diff --git a/tools/tables.go b/tools/tables.go index 39a432a..1c00838 100644 --- a/tools/tables.go +++ b/tools/tables.go @@ -59,6 +59,16 @@ var Arch = map[string]map[string]map[string]string{ "arm64": "arm64", }, }, + Lazygit: { + "darwin": { + "amd64": "x86_64", + "arm64": "arm64", + }, + "linux": { + "amd64": "x86_64", + "arm64": "arm64", + }, + }, Ripgrep: { "darwin": { "amd64": "x86_64", @@ -176,6 +186,16 @@ var OS = map[string]map[string]map[string]string{ "arm64": "linux", }, }, + Lazygit: { + "darwin": { + "amd64": "Darwin", + "arm64": "Darwin", + }, + "linux": { + "amd64": "Linux", + "arm64": "Linux", + }, + }, Ripgrep: { "darwin": { "amd64": "apple-darwin", @@ -241,6 +261,7 @@ var URL = map[string]string{ Flyctl: "https://github.com/superfly/flyctl", K9s: "https://github.com/derailed/k9s", Kubectx: "https://github.com/ahmetb/kubectx", + Lazygit: "https://github.com/jesseduffield/lazygit", Ripgrep: "https://github.com/BurntSushi/ripgrep", Shellcheck: "https://github.com/koalaman/shellcheck", UPX: "https://github.com/upx/upx", diff --git a/tools/tools.go b/tools/tools.go index 1cb251b..c59188f 100644 --- a/tools/tools.go +++ b/tools/tools.go @@ -18,6 +18,7 @@ const ( Flyctl = "flyctl" K9s = "k9s" Kubectx = "kubectx" + Lazygit = "lazygit" Ripgrep = "rg" Shellcheck = "shellcheck" UPX = "upx" @@ -168,6 +169,8 @@ func (t *Tool) SetAsset() error { t.AssetK9s() case Kubectx: t.AssetKubectx() + case Lazygit: + t.AssetLazygit() case Ripgrep: t.AssetRipgrep() case Shellcheck: