Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove Jsonnet leftovers #40

Merged
merged 1 commit into from
Jun 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/zit/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/urfave/cli/v2"
)

const AppVersion = "v3.0.0"
const AppVersion = "v3.0.1"

func main() {
app := &cli.App{
Expand Down
11 changes: 3 additions & 8 deletions internal/config/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,16 @@ import (
)

const (
yamlFormat = "yaml"
jsonnetFormat = "jsonnet"
otherFormat = "other"
yamlFormat = "yaml"
otherFormat = "other"
)

var ErrUnsupportedConfigFormat = fmt.Errorf("unsupported config format")

func Load(filename string) (*ConfigRoot, error) {
format := formatFromFilename(filename)

if format != yamlFormat && format != jsonnetFormat {
if format != yamlFormat {
return nil, ErrUnsupportedConfigFormat
}

Expand All @@ -32,8 +31,6 @@ func Load(filename string) (*ConfigRoot, error) {
return nil, err
}
return parseYaml(contents)
case jsonnetFormat:
return nil, fmt.Errorf("zit no longer supports Jsonnet configs since v3")
default:
return nil, fmt.Errorf("something went horribly wrong")
}
Expand All @@ -42,8 +39,6 @@ func Load(filename string) (*ConfigRoot, error) {
func formatFromFilename(filename string) string {
if strings.HasSuffix(filename, ".yaml") {
return yamlFormat
} else if strings.HasSuffix(filename, ".jsonnet") {
return jsonnetFormat
}
return otherFormat
}
Expand Down
Loading