Skip to content
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
3 changes: 1 addition & 2 deletions app/cli/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ var telemetryWg sync.WaitGroup
// Environment variable prefix for vipers
const envPrefix = "CHAINLOOP"

func Execute(l zerolog.Logger) error {
rootCmd := NewRootCmd(l)
func Execute(rootCmd *cobra.Command) error {
if err := rootCmd.Execute(); err != nil {
// The local file is pointing to the wrong organization, we remove it
if v1.IsUserNotMemberOfOrgErrorNotInOrg(err) {
Expand Down
6 changes: 3 additions & 3 deletions app/cli/main.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2023 The Chainloop Authors.
// Copyright 2023-2025 The Chainloop Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -34,9 +34,9 @@ import (
func main() {
// Couldn't find an easier way to disable the timestamp
logger := zerolog.New(zerolog.ConsoleWriter{Out: os.Stderr, FormatTimestamp: func(interface{}) string { return "" }})

rootCmd := cmd.NewRootCmd(logger)
// Run the command
if err := cmd.Execute(logger); err != nil {
if err := cmd.Execute(rootCmd); err != nil {
msg, exitCode := errorInfo(err, logger)
logger.Error().Msg(msg)
os.Exit(exitCode)
Expand Down
Loading