Bazaar resource directories support symlink (#8263)

* 🎨 bazaar resource directories support symlink

* 🎨 bazaar resource directories support symlink
This commit is contained in:
颖逸 2023-05-16 10:34:38 +08:00 committed by GitHub
parent 85496345ef
commit fdbfe6b848
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 38 additions and 19 deletions

View file

@ -101,6 +101,11 @@ func Icons() (icons []*Icon) {
func InstalledIcons() (ret []*Icon) {
ret = []*Icon{}
if !util.IsPathRegularDirOrSymlinkDir(util.IconsPath) {
return
}
iconDirs, err := os.ReadDir(util.IconsPath)
if nil != err {
logging.LogWarnf("read icons folder failed: %s", err)
@ -110,7 +115,7 @@ func InstalledIcons() (ret []*Icon) {
bazaarIcons := Icons()
for _, iconDir := range iconDirs {
if !iconDir.IsDir() {
if !util.IsDirRegularOrSymlink(iconDir) {
continue
}
dirName := iconDir.Name()