Comparing version 0.6.3 to 0.6.4
@@ -0,1 +1,2 @@ | ||
// copy - copy source directory and its subtree to target directory | ||
@@ -5,16 +6,35 @@ | ||
, resolve = require('path').resolve | ||
, Stream = require('stream').Stream | ||
module.exports = function (source, target, callback) { | ||
var reader = fstream.Reader({ path: source }) | ||
var reader = fstream.Reader({ path: source, filter: filter }) | ||
, writer = fstream.Writer({ path: target, type: 'Directory' }) | ||
, stream = new Stream() | ||
reader.on('error', function (err) { | ||
writer.emit('error', err) | ||
stream.emit('error', err) | ||
}) | ||
reader.on('entry', function (entry) { | ||
if (entry.type === 'File') { | ||
stream.emit('data', entry.basename + '\n') | ||
} | ||
}) | ||
writer.on('error', function (err) { | ||
stream.emit('error', err) | ||
}) | ||
writer.on('end', function () { | ||
stream.emit('end') | ||
if (callback) callback() | ||
}) | ||
return reader.pipe(writer) | ||
reader.pipe(writer) | ||
return stream | ||
} | ||
function filter (entry) { | ||
return !entry.basename.match(/^\./) | ||
} |
{ | ||
"name": "blake", | ||
"description": "Simple, blog aware infrastructure to generate static sites", | ||
"version": "0.6.3", | ||
"version": "0.6.4", | ||
"homepage": "http://michaelnisi.github.com/blake/", | ||
@@ -6,0 +6,0 @@ "repository": { |
@@ -43,8 +43,6 @@ # blake - generate site | ||
, cop = require('cop') | ||
, copy = require('../lib/copy.js') | ||
, copy = require('blake/lib/copy.js') | ||
copy(join(source, 'resources'), target) | ||
.on('error', function (err) { | ||
console.error(err) | ||
}) | ||
.on('error', console.error) | ||
.on('end', function () { | ||
@@ -51,0 +49,0 @@ new Reader(props) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31308
559
268