Skip to content

Commit

Permalink
Merge pull request #934 from cpanato/fix
Browse files Browse the repository at this point in the history
differentiate the local from remote in the version
  • Loading branch information
k8s-ci-robot committed Apr 30, 2024
2 parents 751dc86 + 6151497 commit e00d065
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
12 changes: 9 additions & 3 deletions commands/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,23 @@ import (
"sigs.k8s.io/release-utils/version"
)

const defaultConfigFile = "dependencies.yaml"
type ZeitgeistType string

const (
defaultConfigFile = "dependencies.yaml"
Remote ZeitgeistType = "zeitgeist-remote"
Local ZeitgeistType = "zeitgeist"
)

var rootOpts = &options{}

type Options struct {
LocalOnly bool
}

func New(opts Options) *cobra.Command {
func New(opts Options, zeitVersionType ZeitgeistType) *cobra.Command {
cmd := &cobra.Command{
Use: "zeitgeist",
Use: string(zeitVersionType),
Short: "Zeitgeist is a language-agnostic dependency checker",
PersistentPreRunE: initLogging,
}
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
)

func main() {
if err := commands.New(commands.Options{LocalOnly: true}).Execute(); err != nil {
if err := commands.New(commands.Options{LocalOnly: true}, commands.Local).Execute(); err != nil {
logrus.Fatalf("error during command execution: %#v", err)
}
}
3 changes: 1 addition & 2 deletions remote/zeitgeist/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@ import (
"github.com/sirupsen/logrus"

"sigs.k8s.io/zeitgeist/commands"

// import to link in remote functionality
_ "sigs.k8s.io/zeitgeist/remote/dependency"
)

func main() {
if err := commands.New(commands.Options{LocalOnly: false}).Execute(); err != nil {
if err := commands.New(commands.Options{LocalOnly: false}, commands.Remote).Execute(); err != nil {
logrus.Fatalf("error during command execution: %#v", err)
}
}

0 comments on commit e00d065

Please sign in to comment.