Skip to content

Commit

Permalink
Add 'asdf'
Browse files Browse the repository at this point in the history
  • Loading branch information
myhro committed Feb 17, 2025
1 parent a23b88c commit a60b3dd
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ func main() {
},
}

asdfCmd := newCommand(tools.Asdf, "Extendable version manager with support for multiple runtimes")
batCmd := newCommand(tools.Bat, "A cat(1) clone with wings")
bottomCmd := newCommand(tools.Bottom, "Yet another cross-platform graphical process/system monitor")
cloudflaredCmd := newCommand(tools.Cloudflared, "Argo Tunnel client")
Expand All @@ -115,6 +116,7 @@ func main() {
},
}

rootCmd.AddCommand(asdfCmd)
rootCmd.AddCommand(batCmd)
rootCmd.AddCommand(bottomCmd)
rootCmd.AddCommand(cloudflaredCmd)
Expand Down
4 changes: 4 additions & 0 deletions tools/asset.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import (
"path"
)

func (t *Tool) AssetAsdf() {
t.Asset.Name = fmt.Sprintf("asdf-%v-%v-%v.tar.gz", t.Version, t.OS, t.Arch)
}

func (t *Tool) AssetBat() {
baseName := fmt.Sprintf("bat-%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
@@ -1,6 +1,16 @@
package tools

var Arch = map[string]map[string]map[string]string{
Asdf: {
"darwin": {
"amd64": "amd64",
"arm64": "arm64",
},
"linux": {
"amd64": "amd64",
"arm64": "arm64",
},
},
Bat: {
"darwin": {
"amd64": "x86_64",
Expand Down Expand Up @@ -128,6 +138,16 @@ var Arch = map[string]map[string]map[string]string{
}

var OS = map[string]map[string]map[string]string{
Asdf: {
"darwin": {
"amd64": "darwin",
"arm64": "darwin",
},
"linux": {
"amd64": "linux",
"arm64": "linux",
},
},
Bat: {
"darwin": {
"amd64": "apple-darwin",
Expand Down Expand Up @@ -255,6 +275,7 @@ var OS = map[string]map[string]map[string]string{
}

var URL = map[string]string{
Asdf: "https://github.com/asdf-vm/asdf",
Bat: "https://github.com/sharkdp/bat",
Bottom: "https://github.com/ClementTsang/bottom",
Cloudflared: "https://github.com/cloudflare/cloudflared",
Expand Down
3 changes: 3 additions & 0 deletions tools/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
)

const (
Asdf = "asdf"
Bat = "bat"
Bottom = "btm"
Cloudflared = "cloudflared"
Expand Down Expand Up @@ -166,6 +167,8 @@ func (t *Tool) SetAsset() error {
t.Asset.WithinArchive = t.Name

switch t.Name {
case Asdf:
t.AssetAsdf()
case Bat:
t.AssetBat()
case Bottom:
Expand Down

0 comments on commit a60b3dd

Please sign in to comment.