Skip to content

Commit

Permalink
chore: update code
Browse files Browse the repository at this point in the history
  • Loading branch information
josegonzalez committed Jan 29, 2024
1 parent f50f6c2 commit 1b0ced2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"context"
"fmt"
"os"

Expand All @@ -23,11 +24,12 @@ func main() {

// Executes the specified subcommand
func Run(args []string) int {
commandMeta := command.SetupRun(AppName, Version, args)
ctx := context.Background()
commandMeta := command.SetupRun(ctx, AppName, Version, args)
commandMeta.Ui = ui.ZerologUiWithFields(commandMeta.Ui, make(map[string]interface{}, 0))
c := cli.NewCLI(AppName, Version)
c.Args = os.Args[1:]
c.Commands = command.Commands(commandMeta, Commands)
c.Commands = command.Commands(ctx, commandMeta, Commands)
exitCode, err := c.Run()
if err != nil {
fmt.Fprintf(os.Stderr, "Error executing CLI: %s\n", err.Error())
Expand All @@ -38,7 +40,7 @@ func Run(args []string) int {
}

// Returns a list of implemented commands
func Commands(meta command.Meta) map[string]cli.CommandFactory {
func Commands(ctx context.Context, meta command.Meta) map[string]cli.CommandFactory {
return map[string]cli.CommandFactory{
"build": func() (cli.Command, error) {
return &commands.BuildCommand{Meta: meta}, nil
Expand Down

0 comments on commit 1b0ced2

Please sign in to comment.