2023-06-01 08:33:08 +00:00
|
|
|
package csplugin
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"path/filepath"
|
|
|
|
)
|
|
|
|
|
|
|
|
// helper which gives paths to all files in the given directory non-recursively
|
|
|
|
func listFilesAtPath(path string) ([]string, error) {
|
|
|
|
filePaths := make([]string, 0)
|
|
|
|
files, err := os.ReadDir(path)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
for _, file := range files {
|
2023-06-22 09:31:41 +00:00
|
|
|
if !file.IsDir() {
|
2023-06-01 08:33:08 +00:00
|
|
|
filePaths = append(filePaths, filepath.Join(path, file.Name()))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return filePaths, nil
|
|
|
|
}
|