mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Implement "embedded" command to extract static resources (#9982)
* draft * Implement extract command * Fix nits and force args on extract * Add !bindata stub, support Windows, fmt * fix vendored flag * Remove leading slash for matching * Add docs * Fix typos * Add embedded view command Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
@@ -229,3 +229,16 @@ func AssetNames() []string {
|
||||
}
|
||||
return results
|
||||
}
|
||||
|
||||
func AssetIsDir(name string) (bool, error) {
|
||||
if f, err := Assets.Open("/" + name); err != nil {
|
||||
return false, err
|
||||
} else {
|
||||
defer f.Close()
|
||||
if fi, err := f.Stat(); err != nil {
|
||||
return false, err
|
||||
} else {
|
||||
return fi.IsDir(), nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user