Cirno the Strongest
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
3 additions and
5 deletions
-
modules/svg/discover_bindata.go
-
modules/svg/discover_nobindata.go
|
|
@ -7,7 +7,6 @@ |
|
|
|
package svg |
|
|
|
|
|
|
|
import ( |
|
|
|
"path" |
|
|
|
"path/filepath" |
|
|
|
|
|
|
|
"code.gitea.io/gitea/modules/public" |
|
|
@ -22,7 +21,7 @@ func Discover() map[string]string { |
|
|
|
if matched { |
|
|
|
content, err := public.Asset(file) |
|
|
|
if err == nil { |
|
|
|
filename := path.Base(file) |
|
|
|
filename := filepath.Base(file) |
|
|
|
svgs[filename[:len(filename)-4]] = string(content) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
@ -8,7 +8,6 @@ package svg |
|
|
|
|
|
|
|
import ( |
|
|
|
"io/ioutil" |
|
|
|
"path" |
|
|
|
"path/filepath" |
|
|
|
|
|
|
|
"code.gitea.io/gitea/modules/setting" |
|
|
@ -18,11 +17,11 @@ import ( |
|
|
|
func Discover() map[string]string { |
|
|
|
svgs := make(map[string]string) |
|
|
|
|
|
|
|
files, _ := filepath.Glob(path.Join(setting.StaticRootPath, "public", "img", "svg", "*.svg")) |
|
|
|
files, _ := filepath.Glob(filepath.Join(setting.StaticRootPath, "public", "img", "svg", "*.svg")) |
|
|
|
for _, file := range files { |
|
|
|
content, err := ioutil.ReadFile(file) |
|
|
|
if err == nil { |
|
|
|
filename := path.Base(file) |
|
|
|
filename := filepath.Base(file) |
|
|
|
svgs[filename[:len(filename)-4]] = string(content) |
|
|
|
} |
|
|
|
} |
|
|
|