Skip to content

Commit

Permalink
Add Lua section
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaScorpion committed Feb 19, 2024
1 parent 4bec9af commit 915a9eb
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/versions/all.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ var sections = []section{
Dotnet,
Go,
Java,
Lua,
Node,
Php,
Python,
Expand Down
24 changes: 24 additions & 0 deletions internal/versions/lua.go
Original file line number Diff line number Diff line change
@@ -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]
},
}

0 comments on commit 915a9eb

Please sign in to comment.