1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-12 10:55:20 +02:00
sap-jenkins-library/pkg/whitesource/utils.go

32 lines
797 B
Go
Raw Normal View History

package whitesource
import (
"github.com/SAP/jenkins-library/pkg/maven"
"io"
"os"
)
// File defines the method subset we use from os.File
type File interface {
io.Writer
io.StringWriter
io.Closer
}
// Utils captures all external functionality that needs to be exchangeable in tests.
type Utils interface {
maven.Utils
Chdir(path string) error
Getwd() (string, error)
FileRead(path string) ([]byte, error)
FileWrite(path string, content []byte, perm os.FileMode) error
FileRemove(path string) error
FileRename(oldPath, newPath string) error
RemoveAll(path string) error
FileOpen(name string, flag int, perm os.FileMode) (File, error)
FindPackageJSONFiles(config *ScanOptions) ([]string, error)
InstallAllNPMDependencies(config *ScanOptions, packageJSONFiles []string) error
}