Skip to content

Commit

Permalink
chore: Update go script for data capture
Browse files Browse the repository at this point in the history
Signed-off-by: Terry Howe <[email protected]>
  • Loading branch information
TerryHowe committed Jun 28, 2024
1 parent b1c327f commit a961494
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions versioned_docs/version-1.2/how_to_guides/go_script.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,15 @@ func main() {
args := []string{"repo", "ls", "mcr.microsoft.com"}
cmd := root.New()
cmd.SetArgs(args)
builder := &strings.Builder{}
cmd.SetOut(builder)
fmt.Printf("Executing 'oras %s':", strings.Join(args, " "))
err := cmd.Execute()
if err != nil {
fmt.Errorf("Failed to execute : %w", err)
os.Exit(-1)
}
fmt.Println(builder.String())
os.Exit(0)
}
```
Expand Down

0 comments on commit a961494

Please sign in to comment.