diff --git a/pkg/cmd/attestation/logger/logger.go b/pkg/cmd/attestation/logger/logger.go new file mode 100644 index 000000000..0e5beb62e --- /dev/null +++ b/pkg/cmd/attestation/logger/logger.go @@ -0,0 +1,22 @@ +package logger + +import ( + "fmt" + + "github.com/cli/cli/v2/pkg/iostreams" +) + +type Logger struct { + IO *iostreams.IOStreams + Quiet bool + Verbose bool +} + +func (l *Logger) VerbosePrint(msg string) (int, error) { + if !l.verbose || !opts.IO.IsStdoutTTY() { + return 0, nil + } + + return fmt.Fprintf(l.IO.ErrOut, msg) +} + diff --git a/pkg/cmd/attestation/test/path.go b/pkg/cmd/attestation/test/path.go new file mode 100644 index 000000000..1e8d52cf9 --- /dev/null +++ b/pkg/cmd/attestation/test/path.go @@ -0,0 +1,13 @@ +package test + +import ( + "path/filepath" + "runtime" +) + +func NormalizeRelativePath(posixPath string) string { + if runtime.GOOS == "windows" { + return filepath.FromSlash(posixPath) + } + return posixPath +}