func (f *filemonitor) AddArtifact(a spoolr.Artifact) { log.Println("adding artifact", a) if _, ok := f.artifactSet[a]; !ok { f.artifactSet[a] = true if f.started { f.watcher.Watch(a.RootDir()) } } }
func (g *globalState) insertArtifact(ar spoolr.Artifact) { g.resources = append(g.resources, ar.Name()) g.resourceMap[ar.Name()] = NewResource(ar.Target().File, ar.Target().MimeType) g.pathMap[ar.Name()] = path.Join(ar.RootDir(), "package.json") for _, elem := range ar.Files() { log.Println("adding file", elem, "to buildMap and rootMap entry") g.buildMap[elem] = ar.BuildCmd() g.rootMap[elem] = ar.RootDir() } }