Skip to content

Commit

Permalink
Remove node v0.8 support
Browse files Browse the repository at this point in the history
Nobody should be using node v0.8 at this point, and if they choose to
anyway, they can use older ncp versions.
  • Loading branch information
mmalecki committed Feb 22, 2015
1 parent 06082c5 commit b920f53
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/ncp.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
var fs = require('fs'),
path = require('path');

const modern = /^v0\.1\d\.\d+/.test(process.version);

module.exports = ncp;
ncp.ncp = ncp;

Expand All @@ -24,8 +22,6 @@ function ncp (source, dest, options, callback) {
modified = options.modified,
dereference = options.dereference,
errs = null,
eventName = modern ? 'finish' : 'close',
defer = modern ? setImmediate : process.nextTick,
started = 0,
finished = 0,
running = 0,
Expand Down Expand Up @@ -55,7 +51,7 @@ function ncp (source, dest, options, callback) {
function getStats(source) {
var stat = dereference ? fs.stat : fs.lstat;
if (running >= limit) {
return defer(function () {
return setImmediate(function () {
getStats(source);
});
}
Expand Down Expand Up @@ -128,7 +124,7 @@ function ncp (source, dest, options, callback) {
readStream.pipe(writeStream);
});
}
writeStream.once(eventName, function() {
writeStream.once('finish', function() {
if (modified) {
//target file modified date sync.
fs.utimesSync(target, file.atime, file.mtime);
Expand Down

0 comments on commit b920f53

Please sign in to comment.