mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
Summary: Used addlicense to generate this: addlicense -c "Facebook Inc" -f license_header . example was taken from: https://github.com/facebook/litho/blob/master/lib/soloader/BUCK Reviewed By: alexsn Differential Revision: D17070152 fbshipit-source-id: e7b91398d7f6181727be3400c1872ad5f28e38ed
259 lines
13 KiB
Go
259 lines
13 KiB
Go
// Code generated by go-bindata. (@generated) DO NOT EDIT.
|
|
// sources:
|
|
// template/main.tmpl
|
|
// schema.go
|
|
package load
|
|
|
|
import (
|
|
"bytes"
|
|
"compress/gzip"
|
|
"fmt"
|
|
"io"
|
|
"io/ioutil"
|
|
"os"
|
|
"path/filepath"
|
|
"strings"
|
|
"time"
|
|
)
|
|
|
|
func bindataRead(data []byte, name string) ([]byte, error) {
|
|
gz, err := gzip.NewReader(bytes.NewBuffer(data))
|
|
if err != nil {
|
|
return nil, fmt.Errorf("Read %q: %v", name, err)
|
|
}
|
|
|
|
var buf bytes.Buffer
|
|
_, err = io.Copy(&buf, gz)
|
|
clErr := gz.Close()
|
|
|
|
if err != nil {
|
|
return nil, fmt.Errorf("Read %q: %v", name, err)
|
|
}
|
|
if clErr != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return buf.Bytes(), nil
|
|
}
|
|
|
|
type asset struct {
|
|
bytes []byte
|
|
info os.FileInfo
|
|
}
|
|
|
|
type bindataFileInfo struct {
|
|
name string
|
|
size int64
|
|
mode os.FileMode
|
|
modTime time.Time
|
|
}
|
|
|
|
func (fi bindataFileInfo) Name() string {
|
|
return fi.name
|
|
}
|
|
func (fi bindataFileInfo) Size() int64 {
|
|
return fi.size
|
|
}
|
|
func (fi bindataFileInfo) Mode() os.FileMode {
|
|
return fi.mode
|
|
}
|
|
func (fi bindataFileInfo) ModTime() time.Time {
|
|
return fi.modTime
|
|
}
|
|
func (fi bindataFileInfo) IsDir() bool {
|
|
return false
|
|
}
|
|
func (fi bindataFileInfo) Sys() interface{} {
|
|
return nil
|
|
}
|
|
|
|
var _templateMainTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x54\x91\x41\x6b\xdc\x30\x10\x85\xcf\x9a\x5f\x31\x15\x5b\x22\x81\xa3\xd0\x6b\x61\x4f\xcd\x1e\x52\x68\x52\xd8\x40\x0f\xdb\x25\xc8\xf6\x78\x23\x6a\xcb\xae\xa4\x94\x06\xa1\xff\x5e\x24\xd9\x0b\x3d\xd9\xf2\x7b\xfa\xe6\x3d\x4f\x8c\xd8\xd3\x60\x2c\x21\x9f\xb4\xb1\x1c\x53\x82\xbb\x3b\xfc\x32\xf7\x84\x17\xb2\xe4\x74\xa0\x1e\xdb\x77\xbc\x21\x1b\xba\xeb\xa7\x1b\x85\xf7\x4f\xf8\xf8\xf4\x8c\x87\xfb\x87\x67\x05\x8b\xee\x7e\xe9\x0b\x61\x66\x00\x98\x69\x99\x5d\x40\x01\x8c\xcf\x9e\x03\xe3\xed\x7b\xa0\xfc\x12\x23\x06\x9a\x96\x51\x07\x42\x5e\x5d\xbe\x8c\x2c\xd2\xe2\x8c\x0d\x03\xf2\x8f\xbf\x39\xaa\xef\x2b\x31\x25\x90\x00\x31\xe2\xae\xd5\x9e\xf0\xf3\x1e\xcb\x73\xd3\xf3\xdd\x3f\xda\xa1\xef\x5e\x69\xd2\x1e\xf7\x78\x3a\x93\x0d\xea\xc1\x06\x72\x83\xee\x28\x16\xb4\xd3\xf6\x42\xb8\x7b\x69\x70\x67\xf5\x54\x30\xea\x51\x4f\xe4\x33\x9f\xb1\x18\x6f\x57\x7e\x4a\x2a\x1f\xae\x51\x7c\x4c\x7c\xbd\x93\x52\x53\x58\x64\x7b\xbc\x4d\x09\x12\xc0\xf0\x66\xbb\xd2\x59\x48\x8c\xc0\x72\x90\xd1\x58\xf2\x78\x3a\x9f\xce\xb9\x34\xb0\x61\x76\xf8\xd2\xac\xf9\xf2\xdc\x1a\x65\xcb\x1b\x81\xb1\xb6\x41\x72\x2e\x6b\xdf\xb4\xf3\xaf\x7a\x3c\x16\x51\x54\x8f\x04\xc6\xcc\x50\x1c\x1f\xf6\x68\xcd\x58\xee\xb0\x41\x9b\x51\x90\x73\x59\xce\x15\xea\xdc\x3d\xea\x65\x21\xdb\x8b\x72\x6c\xb0\x95\x90\xd5\xd9\xab\x63\xe8\xe7\xb7\xa0\x7e\x38\x13\x48\x94\x7d\xa8\xaf\xb3\xb1\x9b\xb1\xc6\x15\xfc\xa7\xe5\x52\xca\x6b\xb7\x6d\x4a\x1e\x3f\xbb\x52\xb2\xb2\xc8\xb9\xca\x3a\x06\x67\xec\x25\x7b\xd4\x21\x7b\x84\x94\xc5\x73\xf8\x6b\x82\xf8\x54\x48\xff\x6d\xbd\x96\xaa\x4b\x5f\x7f\x66\x4a\xf0\x2f\x00\x00\xff\xff\xb5\xb1\x2f\xf6\x87\x02\x00\x00")
|
|
|
|
func templateMainTmplBytes() ([]byte, error) {
|
|
return bindataRead(
|
|
_templateMainTmpl,
|
|
"template/main.tmpl",
|
|
)
|
|
}
|
|
|
|
func templateMainTmpl() (*asset, error) {
|
|
bytes, err := templateMainTmplBytes()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
info := bindataFileInfo{name: "template/main.tmpl", size: 647, mode: os.FileMode(420), modTime: time.Unix(1566131522, 0)}
|
|
a := &asset{bytes: bytes, info: info}
|
|
return a, nil
|
|
}
|
|
|
|
var _schemaGo = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x57\x6d\x8f\xd3\x3e\x12\x7f\x9d\x7c\x8a\xa1\x12\xab\x64\xd5\x4b\x39\xde\x5d\x50\x5f\x20\x58\xa4\xbd\x87\xe5\xc4\x72\xf7\x06\x21\x70\xe3\x71\x6b\x48\xec\x60\xbb\x5d\x96\xd5\x7e\xf7\xd3\xf8\x21\x4d\xda\xb2\xf7\xff\x83\x16\x09\x6d\x3c\x4f\x9e\xf9\xcd\xcf\x63\x77\xb1\x80\x57\xba\xbf\x35\x72\xbd\x71\xf0\xfc\xd9\x5f\xff\xf6\x97\xde\xa0\x45\xe5\xe0\x0d\x6b\x70\xa5\xf5\x57\xb8\x54\x4d\x05\x2f\xdb\x16\xbc\x91\x05\xd2\x9b\x1d\xf2\x2a\x5f\x2c\xe0\xfd\x46\x5a\xb0\x7a\x6b\x1a\x84\x46\x73\x04\x69\xa1\x95\x0d\x2a\x8b\x1c\xb6\x8a\xa3\x01\xb7\x41\x78\xd9\xb3\x66\x83\xf0\xbc\x7a\x96\xb4\x20\xf4\x56\x71\x0a\x21\x95\x37\xf9\xe7\xe5\xab\x8b\xab\xeb\x0b\x10\xb2\xc5\x24\x33\x5a\x3b\xe0\xd2\x60\xe3\xb4\xb9\x05\x2d\xc0\x8d\xf6\x73\x06\xb1\xca\xf3\x9e\x35\x5f\xd9\x1a\xa1\xd5\x8c\xe7\xb9\xec\x7a\x6d\x1c\x14\x79\x36\x43\xd5\x68\x2e\xd5\x7a\xf1\xc5\x6a\x35\xcb\xb3\x99\xe8\x1c\xfd\x31\x28\x5a\x6c\xdc\x2c\xcf\xb3\xd9\x5a\xba\xcd\x76\x55\x35\xba\x5b\x88\x58\xb0\x54\xcd\x76\xc5\x9c\x36\x0b\x54\x6e\x61\x9b\x0d\x76\x6c\x81\x7c\x8d\x7f\xc8\x61\xf6\x27\x82\x0a\x89\x2d\x9f\xe5\x65\x4e\x30\x5c\x7b\x19\x18\x8c\x0d\xb0\xc0\x14\xa0\x72\x55\x54\xb8\x0d\x73\x70\xc3\xac\xaf\x13\x39\x08\xa3\x3b\x60\xd0\xe8\xae\x6f\x25\x81\x6d\xd1\x40\xc4\xa2\xca\xdd\x6d\x8f\x29\xa4\x75\x66\xdb\x38\xb8\xcb\xb3\x2b\xd6\x21\x00\x90\x44\xaa\x35\x00\x7c\x26\x68\xea\x99\x62\x1d\xce\x75\x27\x1d\x76\xbd\xbb\x9d\x7d\xce\xb3\x0b\xbe\x46\x0b\x00\x1f\x3e\x9e\xd3\xe7\x60\x49\x38\xd8\xa9\xe9\x1b\xaa\xc2\x7a\x53\xff\x99\x4c\x7d\x75\x07\xb6\x97\x8a\xe3\x77\xb4\x64\xeb\x3f\x93\xad\x0c\xf2\x89\xf1\xbd\x87\x25\x84\x3c\x46\x25\xc8\x7f\x01\x94\xe0\x78\x8c\xc9\x18\x96\x07\x80\x79\x4f\x31\xc2\x3f\x5f\x60\xe5\x05\xd1\x9c\x36\x38\x30\x67\x6b\xf8\x69\x74\xc7\xd6\x53\xeb\x6b\xf9\x23\x05\x3f\x97\xca\xc5\xcf\x68\x6d\xe5\x8f\x83\xe0\xaf\x36\xcc\x58\xf4\x66\xe7\xfb\xe8\xd1\xbc\x09\xca\xa9\xc7\x7f\x94\xfc\xb6\x0d\x5b\xac\xb4\x6e\xa7\x1b\x6c\xbd\x72\xea\x70\x25\xdb\x96\xad\x5a\x3c\xe9\xa0\xa2\x72\xea\xf2\xb6\x77\x52\x2b\xd6\x9e\x74\xd1\x51\x39\x75\x79\x8d\x82\x6d\x5b\x77\x3a\x2d\x1e\x94\x07\x44\xea\xba\xad\x0b\x89\x1d\x7b\xc8\xa4\x9c\xfa\xfc\x97\xb5\x92\xd3\x19\xb4\xb0\x07\x37\xf9\xec\x06\xe5\x09\x12\xfa\x23\x70\xcc\x41\x2f\xfe\x05\x0a\x7a\xbf\x13\x0c\x8c\x3d\xfc\xff\xdc\x9b\x1a\x3e\xc0\xba\x03\xc3\x43\xbe\xbd\x43\x11\x36\x9f\xda\x19\x14\x9f\x8e\x77\x7f\x87\x22\x52\x73\x32\x11\x0c\x8a\x9f\x70\x2c\x36\xe6\x01\x76\x5d\xaa\x1d\x1a\x8b\x87\xa6\x32\x88\x0f\xb7\xff\xb6\x95\x06\xf9\x81\xad\x89\xe2\x13\x5d\x0b\x13\xe6\xb8\x6d\x41\xfe\x0b\x7d\x0b\x8e\xfb\xc6\xc5\x4a\x07\x02\x3e\x50\x69\x9c\xa7\x1f\x3e\x4e\x91\xfe\xf9\x38\x3d\xb4\x3c\x31\x4d\x43\x95\x57\x78\xe3\xfb\xd1\x18\x64\x0e\x7d\x91\xb1\x22\x0a\x1e\xca\xf2\x5f\x1c\x6d\x63\x64\xef\xb4\xa9\x72\xb1\x55\x4d\xf2\x2c\x90\xc3\x39\x59\x54\xaf\x07\x8b\x32\x36\xf9\x2e\xcf\x14\x42\xbd\x84\x33\x5a\xde\xe5\x19\x51\xab\x0e\x34\x40\x5e\xbd\x67\xeb\x39\xc9\x6e\x7b\xac\x07\x19\xb1\x31\xcf\x3c\xab\x07\x21\x2d\x48\x18\x10\xab\x83\x30\x2c\x48\x1c\x79\x50\x7b\x71\x5c\x90\x3c\xf5\xbc\x26\x79\x5a\x04\x85\x88\xf1\xbd\x42\xc4\xf8\xf7\x79\x26\x05\x18\x14\x94\x72\xd0\xbc\xf0\xcb\x27\x4b\x50\xb2\xa5\x72\x32\x85\x24\x86\xe5\x50\xbe\x41\x51\x7a\x57\x83\x6e\x6b\x14\x28\x8c\xc8\xfe\x8b\x19\xbb\x61\x6d\xbc\x45\xfd\x6b\x02\xfd\xb3\x64\x74\x2b\x4b\xe5\xd0\xd0\x25\x4f\x5f\x1a\x18\xfc\xfd\xfa\xed\x15\x39\x7b\x7a\x35\x4c\xc1\x8a\x90\x27\x57\x1e\x4c\x28\x40\x74\xd6\xab\x2f\xd8\xb8\xf8\x27\x36\x65\xb2\x69\x61\xd3\xde\xc4\xda\xb8\x53\x09\xc5\x0a\x3e\x7c\x5c\xdd\x3a\x9c\x03\x1a\x43\xff\xa9\x63\x77\x79\x66\x7d\xab\x82\xef\x5d\x00\x48\xaa\xf0\x7e\x2a\xe2\xab\xc7\xf7\xe7\xad\x88\x91\xcb\xd2\xb7\xa6\x28\xef\xf3\x2c\x32\xcc\x87\xac\x97\x60\x99\xc0\xc0\xc5\x64\xeb\xc1\x25\xed\x08\xcd\x84\x99\x6c\xe7\x20\x3a\x57\x5d\x50\x2e\xa2\x98\xc5\xc4\x9f\x7e\xab\xe1\xe9\x6e\x36\x07\x1b\x28\x40\xee\x01\x6c\xa1\x0d\x7c\x9a\x83\xef\x94\x61\x8a\x98\x1a\x88\x4f\x51\x05\x27\xb1\x18\x11\xb2\x28\xf3\x2c\xb3\xde\xfa\xcc\x67\x45\x66\x23\x8e\x01\x88\x3d\xcb\x46\x84\xf4\xf2\x44\xc9\x11\x79\x83\x3c\xd0\x77\xc4\x4a\x2f\xde\xf3\x32\x5d\x4c\x75\xd4\xa4\x7b\x2a\x00\xe0\x2d\xd2\x05\x59\xc7\x14\xd2\x95\x48\xba\x74\x13\x46\x5d\x5a\x7a\xdd\x70\x81\xd5\x5e\x37\x2c\xbd\x72\x7f\x53\xd5\xd0\xa2\x2a\x04\xaf\xf6\xa2\x92\x4c\xee\xf3\x8c\xba\x21\x78\xe5\xdf\x0c\x4f\x96\xf0\xcc\x23\x97\x59\x11\x24\x4b\x38\x8b\xca\x89\x75\x7a\x32\x3c\x59\xc2\x6c\x36\x78\x24\x69\x70\x8a\xab\xe8\x67\xab\x38\x91\x96\xc0\xfa\x1e\x15\x2f\x92\x64\x0e\x36\x9e\x9c\x30\xc6\xc6\xcc\xf1\xf3\xee\x31\x89\x83\x7b\xe2\xf8\xdd\x7d\x50\x5b\x85\x39\x3b\x4a\xf5\x22\xa4\x36\xcc\xba\x09\xa7\xca\x10\x32\xbd\x3e\xc7\x05\xc4\x97\xea\x63\x96\x20\xf9\xf7\x7d\x11\x31\x07\x1f\x38\x2a\x24\xff\x7e\x74\x02\xaa\xf4\x82\x1e\x95\x78\x99\xd2\x3f\xf3\x5f\xbe\xa9\xbe\xec\x1a\x7c\x8c\x00\x01\x49\x43\xdf\x6a\x2f\x8d\x3d\x1c\xf3\x9f\xc4\x7b\xf2\xdf\x4f\xa6\x22\xdd\x42\x55\x1c\x4e\x85\x2d\xe3\x88\xdc\x0f\x09\xb8\x31\xac\xb7\x7e\xba\x85\xfa\x13\x6d\x3a\x74\x1b\xcd\xe1\x46\xba\x0d\x18\x6c\xf4\x8e\x7e\x12\x6a\x40\x65\xb7\x06\x41\x69\xe8\x99\x92\x0d\x3d\xc9\xa0\x0b\xe1\xa5\x5a\xc7\x61\x78\x34\x83\x8e\x26\xa1\x48\xb7\xe5\xf0\x9b\xe0\x70\x26\x72\x14\x68\x80\xc2\x15\x65\x40\x57\xc0\xce\xe3\x1e\x92\x29\xca\x17\xb0\x1b\xb7\x35\x23\xff\xe5\x89\x8e\xa6\x8a\x42\xc2\xb1\xb9\x3b\x6a\x4b\x9c\x9d\xe0\x83\x84\x73\x73\x4f\xfd\x8a\xd8\x4d\xdc\x8b\x72\xee\xad\xf6\x00\x06\xce\x1e\xe1\x17\xc4\xbf\x0b\xdf\xf8\x20\x1e\xa1\x17\x4e\x4e\x00\x8f\x0c\x1f\x11\xbb\x50\xcd\x09\xe8\x30\x9e\xd8\x87\x90\x0b\x45\x1c\x01\x97\xce\xc2\x11\x74\x49\xf1\xbb\xe0\x4d\x87\xc0\x11\x7c\x72\xf8\x35\x3b\x3c\x2b\x1f\x11\xc1\x54\xd4\x09\x0c\xe5\x30\x14\x1e\x42\x31\x55\xb3\xc7\xd1\x17\x3a\xbc\x10\x1c\x8c\xdf\x08\xe5\x64\x45\xb9\xd1\xd8\x72\xd5\x3f\xa4\xe2\x45\x09\xcb\xe5\xa0\xff\xb7\x33\x3e\x75\xba\x3f\x5c\x75\xd1\x62\x57\x4c\x46\x87\xcb\xef\xf3\xff\x05\x00\x00\xff\xff\x5b\x59\x31\xf1\x68\x12\x00\x00")
|
|
|
|
func schemaGoBytes() ([]byte, error) {
|
|
return bindataRead(
|
|
_schemaGo,
|
|
"schema.go",
|
|
)
|
|
}
|
|
|
|
func schemaGo() (*asset, error) {
|
|
bytes, err := schemaGoBytes()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
info := bindataFileInfo{name: "schema.go", size: 4712, mode: os.FileMode(420), modTime: time.Unix(1566903821, 0)}
|
|
a := &asset{bytes: bytes, info: info}
|
|
return a, nil
|
|
}
|
|
|
|
// Asset loads and returns the asset for the given name.
|
|
// It returns an error if the asset could not be found or
|
|
// could not be loaded.
|
|
func Asset(name string) ([]byte, error) {
|
|
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
|
if f, ok := _bindata[cannonicalName]; ok {
|
|
a, err := f()
|
|
if err != nil {
|
|
return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
|
|
}
|
|
return a.bytes, nil
|
|
}
|
|
return nil, fmt.Errorf("Asset %s not found", name)
|
|
}
|
|
|
|
// MustAsset is like Asset but panics when Asset would return an error.
|
|
// It simplifies safe initialization of global variables.
|
|
func MustAsset(name string) []byte {
|
|
a, err := Asset(name)
|
|
if err != nil {
|
|
panic("asset: Asset(" + name + "): " + err.Error())
|
|
}
|
|
|
|
return a
|
|
}
|
|
|
|
// AssetInfo loads and returns the asset info for the given name.
|
|
// It returns an error if the asset could not be found or
|
|
// could not be loaded.
|
|
func AssetInfo(name string) (os.FileInfo, error) {
|
|
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
|
if f, ok := _bindata[cannonicalName]; ok {
|
|
a, err := f()
|
|
if err != nil {
|
|
return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
|
|
}
|
|
return a.info, nil
|
|
}
|
|
return nil, fmt.Errorf("AssetInfo %s not found", name)
|
|
}
|
|
|
|
// AssetNames returns the names of the assets.
|
|
func AssetNames() []string {
|
|
names := make([]string, 0, len(_bindata))
|
|
for name := range _bindata {
|
|
names = append(names, name)
|
|
}
|
|
return names
|
|
}
|
|
|
|
// _bindata is a table, holding each asset generator, mapped to its name.
|
|
var _bindata = map[string]func() (*asset, error){
|
|
"template/main.tmpl": templateMainTmpl,
|
|
"schema.go": schemaGo,
|
|
}
|
|
|
|
// AssetDir returns the file names below a certain
|
|
// directory embedded in the file by go-bindata.
|
|
// For example if you run go-bindata on data/... and data contains the
|
|
// following hierarchy:
|
|
// data/
|
|
// foo.txt
|
|
// img/
|
|
// a.png
|
|
// b.png
|
|
// then AssetDir("data") would return []string{"foo.txt", "img"}
|
|
// AssetDir("data/img") would return []string{"a.png", "b.png"}
|
|
// AssetDir("foo.txt") and AssetDir("notexist") would return an error
|
|
// AssetDir("") will return []string{"data"}.
|
|
func AssetDir(name string) ([]string, error) {
|
|
node := _bintree
|
|
if len(name) != 0 {
|
|
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
|
pathList := strings.Split(cannonicalName, "/")
|
|
for _, p := range pathList {
|
|
node = node.Children[p]
|
|
if node == nil {
|
|
return nil, fmt.Errorf("Asset %s not found", name)
|
|
}
|
|
}
|
|
}
|
|
if node.Func != nil {
|
|
return nil, fmt.Errorf("Asset %s not found", name)
|
|
}
|
|
rv := make([]string, 0, len(node.Children))
|
|
for childName := range node.Children {
|
|
rv = append(rv, childName)
|
|
}
|
|
return rv, nil
|
|
}
|
|
|
|
type bintree struct {
|
|
Func func() (*asset, error)
|
|
Children map[string]*bintree
|
|
}
|
|
|
|
var _bintree = &bintree{nil, map[string]*bintree{
|
|
"schema.go": &bintree{schemaGo, map[string]*bintree{}},
|
|
"template": &bintree{nil, map[string]*bintree{
|
|
"main.tmpl": &bintree{templateMainTmpl, map[string]*bintree{}},
|
|
}},
|
|
}}
|
|
|
|
// RestoreAsset restores an asset under the given directory
|
|
func RestoreAsset(dir, name string) error {
|
|
data, err := Asset(name)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
info, err := AssetInfo(name)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755))
|
|
if err != nil {
|
|
return err
|
|
}
|
|
err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode())
|
|
if err != nil {
|
|
return err
|
|
}
|
|
err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
|
|
if err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// RestoreAssets restores an asset under the given directory recursively
|
|
func RestoreAssets(dir, name string) error {
|
|
children, err := AssetDir(name)
|
|
// File
|
|
if err != nil {
|
|
return RestoreAsset(dir, name)
|
|
}
|
|
// Dir
|
|
for _, child := range children {
|
|
err = RestoreAssets(dir, filepath.Join(name, child))
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func _filePath(dir, name string) string {
|
|
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
|
return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
|
|
}
|