chore: search by type with empty file name (#1228)

This commit is contained in:
WeidiDeng
2021-01-13 01:08:23 +08:00
committed by GitHub
parent c8257e848e
commit b6263eb607
2 changed files with 5 additions and 1 deletions

View File

@@ -65,6 +65,10 @@ func Search(fs afero.Fs, scope, query string, checker rules.Checker, found func(
return found(originalPath, f)
}
}
} else {
originalPath = strings.TrimPrefix(originalPath, scope)
originalPath = strings.TrimPrefix(originalPath, "/")
return found(originalPath, f)
}
return nil