Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
b4c0284734 | |||
c5d1dad8de |
@@ -4,6 +4,7 @@ import (
|
||||
"cook/logger"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/bmatcuk/doublestar/v4"
|
||||
@@ -171,13 +172,13 @@ func LoadCommands(args []string) ([]ModifyCommand, error) {
|
||||
}
|
||||
|
||||
func LoadCommandsFromCookFiles(pattern string) ([]ModifyCommand, error) {
|
||||
root, pattern, err := FigureOutGlobRoot(pattern)
|
||||
cwd, err := os.Getwd()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to figure out glob root: %w", err)
|
||||
return nil, fmt.Errorf("failed to get current working directory: %w", err)
|
||||
}
|
||||
|
||||
commands := []ModifyCommand{}
|
||||
cookFiles, err := doublestar.Glob(os.DirFS(root), pattern)
|
||||
cookFiles, err := doublestar.Glob(os.DirFS(cwd), pattern)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to glob cook files: %w", err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user