Skip to content

Commit

Permalink
Fix example (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
outofforest committed Aug 14, 2024
1 parent 3ac6806 commit c62ce45
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,15 @@ import (
// go run . bCmd
// go run . cCmd

var commands = map[string]build.Command{
"aCmd": {Fn: commandA, Description: "This is commandA"},
"aCmd/aaCmd": {Fn: commandAA, Description: "This is commandAA"},
"aCmd/abCmd": {Fn: commandAB, Description: "This is commandAB"},
"bCmd": {Fn: commandB, Description: "This is commandB"},
"cCmd": {Fn: commandC, Description: "This is commandC"},
}

func main() {
build.Main("env-name", commands)
build.RegisterCommands(map[string]build.Command{
"aCmd": {Fn: commandA, Description: "This is commandA"},
"aCmd/aaCmd": {Fn: commandAA, Description: "This is commandAA"},
"aCmd/abCmd": {Fn: commandAB, Description: "This is commandAB"},
"bCmd": {Fn: commandB, Description: "This is commandB"},
"cCmd": {Fn: commandC, Description: "This is commandC"},
})
build.Main("env-name")
}

func commandA(ctx context.Context, deps build.DepsFunc) error {
Expand Down

0 comments on commit c62ce45

Please sign in to comment.