Skip to content

Commit

Permalink
Write script-friendly output
Browse files Browse the repository at this point in the history
  • Loading branch information
codingllama committed Jan 22, 2025
1 parent 344da97 commit 492ba3d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tool/tctl/common/auth_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,12 +265,13 @@ func (a *AuthCommand) ExportAuthorities(ctx context.Context, clt authCommandClie
perms = 0600
}

fmt.Fprintf(os.Stderr, "Writing %d files with prefix %q\n", len(authorities), a.output)
for i, authority := range authorities {
name := fmt.Sprintf("%s%d.cer", a.output, i)
if err := os.WriteFile(name, authority.Data, perms); err != nil {
return trace.Wrap(err)
}
fmt.Printf("Wrote %s\n", name)
fmt.Println(name)
}
return nil
}
Expand Down

0 comments on commit 492ba3d

Please sign in to comment.