aboutsummaryrefslogtreecommitdiff
path: root/common.go
diff options
context:
space:
mode:
Diffstat (limited to 'common.go')
-rw-r--r--common.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/common.go b/common.go
index 56bffd1..d8e2d28 100644
--- a/common.go
+++ b/common.go
@@ -84,7 +84,6 @@ func parse(dirPath string, elements map[string][]byte, exts []string, overwrite
84} 84}
85 85
86func compile(dirPath string, elements map[string][]byte, sourceDir, outputDir, saveAs string, exts []string, recursive bool) { 86func compile(dirPath string, elements map[string][]byte, sourceDir, outputDir, saveAs string, exts []string, recursive bool) {
87 wait.Add(1)
88 defer wait.Done() 87 defer wait.Done()
89 88
90 if strings.HasPrefix(dirPath, outputDir) { 89 if strings.HasPrefix(dirPath, outputDir) {
@@ -96,6 +95,7 @@ func compile(dirPath string, elements map[string][]byte, sourceDir, outputDir, s
96 if recursive { 95 if recursive {
97 dirs, _ := fcmd.Ls(dirPath) 96 dirs, _ := fcmd.Ls(dirPath)
98 for _, dir := range dirs { 97 for _, dir := range dirs {
98 wait.Add(1)
99 go compile(path.Join(dirPath, dir), elements, sourceDir, outputDir, saveAs, exts, recursive) 99 go compile(path.Join(dirPath, dir), elements, sourceDir, outputDir, saveAs, exts, recursive)
100 } 100 }
101 } 101 }
@@ -111,7 +111,6 @@ func compile(dirPath string, elements map[string][]byte, sourceDir, outputDir, s
111} 111}
112 112
113func copyFiles(dirPath, sourceDir, outputDir string, exts []string, recursive bool) { 113func copyFiles(dirPath, sourceDir, outputDir string, exts []string, recursive bool) {
114 wait.Add(1)
115 defer wait.Done() 114 defer wait.Done()
116 115
117 if strings.HasPrefix(dirPath, outputDir) { 116 if strings.HasPrefix(dirPath, outputDir) {
@@ -130,6 +129,7 @@ func copyFiles(dirPath, sourceDir, outputDir string, exts []string, recursive bo
130 129
131 if recursive { 130 if recursive {
132 for _, dir := range dirs { 131 for _, dir := range dirs {
132 wait.Add(1)
133 go copyFiles(path.Join(dirPath, dir), sourceDir, outputDir, exts, recursive) 133 go copyFiles(path.Join(dirPath, dir), sourceDir, outputDir, exts, recursive)
134 } 134 }
135 } 135 }