Skip to content

Commit

Permalink
Merge pull request #38 from oalders/hugo
Browse files Browse the repository at this point in the history
Add Hugo version parsing
  • Loading branch information
oalders authored Oct 29, 2024
2 parents c700ef3 + 3c13f91 commit 44a8149
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21.1
go-version: 1.23.0

- name: Build
run: go build -v ./...
Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21.1
go-version: 1.23.0

- name: Build
run: go build -v ./...
Expand All @@ -69,7 +69,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21.1
go-version: 1.23.0

- name: install gofumpt
run: go install mvdan.cc/gofumpt@latest
Expand Down
2 changes: 1 addition & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ linters:
- bodyclose
- containedctx
- contextcheck
- copyloopvar
- cyclop
- decorder
# - depguard
Expand All @@ -25,7 +26,6 @@ linters:
- exhaustive
# - exhaustivestruct
# - exhaustruct
- exportloopref
- forbidigo
- forcetypeassert
- funlen
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/oalders/is

go 1.20
go 1.23

require (
github.com/alecthomas/kong v0.7.1
Expand Down
2 changes: 2 additions & 0 deletions parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
func CLIOutput(ctx *types.Context, cliName string) (string, error) {
versionArg := map[string]string{
"dig": "-v",
"hugo": "version",
"go": "version",
"lua": "-v",
"openssl": "version",
Expand Down Expand Up @@ -87,6 +88,7 @@ func CLIVersion(ctx *types.Context, cliName, output string) string {
"gh": fmt.Sprintf(`gh version (%s)\b`, semverRegex),
"go": fmt.Sprintf(`go version go(%s)\s`, semverRegex),
"grep": fmt.Sprintf(`(%s|%s)`, semverRegex, floatRegex),
"hugo": fmt.Sprintf(`hugo v(%s)\b`, semverRegex),
"jq": fmt.Sprintf(`jq-(%s)\b`, floatRegex),
"less": fmt.Sprintf(`less (%s)\b`, intRegex),
"lua": fmt.Sprintf(`Lua (%s)\b`, semverRegex),
Expand Down
1 change: 1 addition & 0 deletions parser/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Written by Mike Haertel and others; see
{"grep", "2.6.0", "grep (BSD grep, GNU compatible) 2.6.0-FreeBSD"},
{"gh", "2.30.0", "gh version 2.30.0 (2023-05-30)"},
{"go", "1.20.4", "go version go1.20.4 darwin/amd64"},
{"hugo", "0.136.5", "hugo v0.136.5+extended darwin/arm64 BuildDate=2024-10-24T12:26:27Z VendorInfo=brew"},
{"jq", "1.6", "jq-1.6"},
{"less", "633", "less 633 (PCRE2 regular expressions)"},
{"lua", "5.4.6", "Lua 5.4.6 Copyright (C) 1994-2023 Lua.org, PUC-Rio"},
Expand Down

0 comments on commit 44a8149

Please sign in to comment.