Bugfixes
This commit is contained in:
parent
3155de7542
commit
14c9c2065f
@ -84,14 +84,20 @@ func (goldsmith *Goldsmith) FilterPop() *Goldsmith {
|
|||||||
func (goldsmith *Goldsmith) End(targetDir string) []error {
|
func (goldsmith *Goldsmith) End(targetDir string) []error {
|
||||||
goldsmith.targetDir = targetDir
|
goldsmith.targetDir = targetDir
|
||||||
|
|
||||||
|
var wg sync.WaitGroup
|
||||||
goldsmith.Chain(&saver{
|
goldsmith.Chain(&saver{
|
||||||
clean: goldsmith.clean,
|
clean: goldsmith.clean,
|
||||||
|
wg: &wg,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
wg.Add(1)
|
||||||
|
|
||||||
for _, context := range goldsmith.contexts {
|
for _, context := range goldsmith.contexts {
|
||||||
go context.step()
|
go context.step()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wg.Wait()
|
||||||
|
|
||||||
return goldsmith.errors
|
return goldsmith.errors
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4
saver.go
4
saver.go
@ -3,11 +3,13 @@ package goldsmith
|
|||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
type saver struct {
|
type saver struct {
|
||||||
clean bool
|
clean bool
|
||||||
tokens map[string]bool
|
tokens map[string]bool
|
||||||
|
wg *sync.WaitGroup
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*saver) Name() string {
|
func (*saver) Name() string {
|
||||||
@ -29,6 +31,8 @@ func (saver *saver) Process(context *Context, file *File) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (saver *saver) Finalize(context *Context) error {
|
func (saver *saver) Finalize(context *Context) error {
|
||||||
|
defer saver.wg.Done()
|
||||||
|
|
||||||
if !saver.clean {
|
if !saver.clean {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user