Skip to content

Commit

Permalink
Add Lua version section (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaScorpion committed Feb 19, 2024
1 parent 4bec9af commit 05ccf19
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ This should print a "branch" icon.
- .NET
- Go
- Java
- Lua
- Node.js
- PHP
- Python
Expand Down
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 05ccf19

Please sign in to comment.