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) {
|
||||
confRoot = filepath.Clean(confRoot)
|
||||
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 {
|
||||
slog.Error("list valid scopes", "error", err)
|
||||
return err
|
||||
|
@ -179,7 +181,11 @@ func ListValidScopes(confRoot, confName string) ([]string, error) {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
validScopes = append(validScopes, relPath)
|
||||
if relPath == "." {
|
||||
relPath = ""
|
||||
}
|
||||
validScopes = append(validScopes,
|
||||
fmt.Sprintf("\"%s\"", relPath))
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
|
Loading…
Reference in New Issue
Block a user