Skip to content

Commit

Permalink
Add 'lazygit'
Browse files Browse the repository at this point in the history
  • Loading branch information
myhro committed Oct 19, 2024
1 parent f10e33f commit cbcc108
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
9 changes: 9 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions tools/asset.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
21 changes: 21 additions & 0 deletions tools/tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions tools/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const (
Flyctl = "flyctl"
K9s = "k9s"
Kubectx = "kubectx"
Lazygit = "lazygit"
Ripgrep = "rg"
Shellcheck = "shellcheck"
UPX = "upx"
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit cbcc108

Please sign in to comment.