Skip to content
Browse files

Only copy files right from source. Do not recurse into sub-directorie…

…s. Fixes problems with .svn/ and such
  • Loading branch information...
1 parent b809f6e commit 2a9d6ec7312a8bcb7257f1b333cd83e5fbaa9817 @brandonramirez brandonramirez committed
Showing with 24 additions and 4 deletions.
  1. +24 −4 lib/buildr.coffee
View
28 lib/buildr.coffee
@@ -350,10 +350,30 @@ class Buildr
return next err if err
# Copy srcPath to outPath
- util.cpdir config.srcPath, config.outPath, (err) ->
- # Next
- log 'debug', "Copied #{config.srcPath} to #{config.outPath}"
- next err
+ fs.mkdir config.outPath, (mkdirError) ->
+ return next mkdirError if mkdirError
+
+ fs.readdir config.srcPath, (err, files) ->
+ return next err if err
+
+ copyableFiles = []
+
+ statTasks = new util.Group (groupError) ->
+ copyTasks = new util.Group (groupError) ->
+ log 'debug', "Copied #{config.srcPath} to #{config.outPath}"
+ next err
+
+ copyTasks.total = copyableFiles.length
+ copyableFiles.forEach (file) ->
+ fs.readFile config.srcPath + '/' + file, 'utf8', (err, data) ->
+ fs.writeFile config.outPath + '/' + file, data, 'utf8', copyTasks.completer()
+
+ statTasks.total = files.length
+
+ files.forEach (file) ->
+ fs.stat config.srcPath + '/' + file, (error, stat) ->
+ copyableFiles.push(file) if stat.isFile()
+ statTasks.completer()()
# Completed
true

0 comments on commit 2a9d6ec

Please sign in to comment.
Something went wrong with that request. Please try again.