diff --git a/internal/versions/all.go b/internal/versions/all.go index 1ce3ff7..7ccd07e 100644 --- a/internal/versions/all.go +++ b/internal/versions/all.go @@ -9,6 +9,7 @@ var sections = []section{ Dotnet, Go, Java, + Lua, Node, Php, Python, diff --git a/internal/versions/lua.go b/internal/versions/lua.go new file mode 100644 index 0000000..74555d4 --- /dev/null +++ b/internal/versions/lua.go @@ -0,0 +1,24 @@ +package versions + +import ( + "gokart-prompt/internal/ansi" + "strings" +) + +var Lua = section{ + symbol: "🌙", + color: ansi.Blue, + + wdFiles: []string{ + "*.lua", + }, + + command: []string{"lua", "-v"}, + versionFn: func(output string) string { + /* + Example: + Lua 5.4.6 Copyright (C) 1994-2023 Lua.org, PUC-Rio + */ + return "v" + strings.SplitN(output, " ", 3)[1] + }, +}