mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-09-19 09:40:12 +00:00
fix(agentcompat): root workflow file reads
Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
This commit is contained in:
@@ -3,6 +3,7 @@ package workflowpolicy
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"path/filepath"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
@@ -25,7 +26,12 @@ func Verify(data []byte, repository Repository) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func VerifyFile(path string, repository Repository) error {
|
func VerifyFile(path string, repository Repository) error {
|
||||||
data, err := os.ReadFile(path)
|
root, err := os.OpenRoot(filepath.Dir(path))
|
||||||
|
if err != nil {
|
||||||
|
return &ReadError{Path: path, Cause: err}
|
||||||
|
}
|
||||||
|
defer root.Close()
|
||||||
|
data, err := root.ReadFile(filepath.Base(path))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &ReadError{Path: path, Cause: err}
|
return &ReadError{Path: path, Cause: err}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user