feat(cmd/joj3): add quote to valid scopes
This commit is contained in:
parent
b799c15248
commit
c30ed44633
|
@ -167,7 +167,9 @@ func ParseMsg(confRoot, confName, msg string) (conf Conf, group string, err erro
|
||||||
func ListValidScopes(confRoot, confName string) ([]string, error) {
|
func ListValidScopes(confRoot, confName string) ([]string, error) {
|
||||||
confRoot = filepath.Clean(confRoot)
|
confRoot = filepath.Clean(confRoot)
|
||||||
validScopes := []string{}
|
validScopes := []string{}
|
||||||
err := filepath.Walk(confRoot, func(path string, info os.FileInfo, err error) error {
|
err := filepath.Walk(confRoot, func(
|
||||||
|
path string, info os.FileInfo, err error,
|
||||||
|
) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
slog.Error("list valid scopes", "error", err)
|
slog.Error("list valid scopes", "error", err)
|
||||||
return err
|
return err
|
||||||
|
@ -179,7 +181,11 @@ func ListValidScopes(confRoot, confName string) ([]string, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
validScopes = append(validScopes, relPath)
|
if relPath == "." {
|
||||||
|
relPath = ""
|
||||||
|
}
|
||||||
|
validScopes = append(validScopes,
|
||||||
|
fmt.Sprintf("\"%s\"", relPath))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue
Block a user