MCPcopy Index your code
hub / github.com/bytesizedhosting/bcd / RestoreAssets

Function RestoreAssets

plugins/plugin_data.go:1171–1185  ·  view source on GitHub ↗

RestoreAssets restores an asset under the given directory recursively

(dir, name string)

Source from the content-addressed store, hash-verified

1169
1170// RestoreAssets restores an asset under the given directory recursively
1171func RestoreAssets(dir, name string) error {
1172 children, err := AssetDir(name)
1173 // File
1174 if err != nil {
1175 return RestoreAsset(dir, name)
1176 }
1177 // Dir
1178 for _, child := range children {
1179 err = RestoreAssets(dir, filepath.Join(name, child))
1180 if err != nil {
1181 return err
1182 }
1183 }
1184 return nil
1185}
1186
1187func _filePath(dir, name string) string {
1188 cannonicalName := strings.Replace(name, "\\", "/", -1)

Callers

nothing calls this directly

Calls 2

AssetDirFunction · 0.85
RestoreAssetFunction · 0.85

Tested by

no test coverage detected