func readAndPrepareFiles(filenames []string, results chan themekit.AssetEvent) { for _, filename := range filenames { asset, err := loadAsset(filename) if err == nil { results <- themekit.NewUploadEvent(asset) } else if err.Error() != "File is a directory" { themekit.NotifyError(err) } } close(results) }
func enqueueEvents(client themekit.ThemeClient, filenames []string, events chan themekit.AssetEvent) { root, _ := os.Getwd() if len(filenames) == 0 { go fullReplace(client.AssetListSync(), client.LocalAssets(root), events) return } go func() { for _, filename := range filenames { asset, err := themekit.LoadAsset(root, filename) if err == nil { events <- themekit.NewUploadEvent(asset) } } close(events) }() }