MCPcopy
hub / github.com/git-lfs/git-lfs / logsShowCommand

Function logsShowCommand

commands/command_logs.go:29–43  ·  view source on GitHub ↗
(cmd *cobra.Command, args []string)

Source from the content-addressed store, hash-verified

27}
28
29func logsShowCommand(cmd *cobra.Command, args []string) {
30 if len(args) == 0 {
31 Print(tr.Tr.Get("Supply a log name."))
32 return
33 }
34
35 name := args[0]
36 by, err := os.ReadFile(filepath.Join(cfg.LocalLogDir(), name))
37 if err != nil {
38 Exit(tr.Tr.Get("Error reading log: %s", name))
39 }
40
41 tracerx.Printf("Reading log: %s", name)
42 os.Stdout.Write(by)
43}
44
45func logsClearCommand(cmd *cobra.Command, args []string) {
46 err := os.RemoveAll(cfg.LocalLogDir())

Callers 1

logsLastCommandFunction · 0.85

Calls 5

PrintFunction · 0.85
ExitFunction · 0.85
LocalLogDirMethod · 0.80
GetMethod · 0.65
WriteMethod · 0.45

Tested by

no test coverage detected