Skip to content

Commit

Permalink
Bump devDependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Feb 25, 2016
1 parent 829032d commit 16b2852
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 34 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"devDependencies": {
"grunt": "^0.4.5",
"grunt-cli": "^0.1.13",
"grunt-contrib-clean": "^0.6.0",
"grunt-contrib-clean": "^1.0.0",
"grunt-contrib-internal": "^0.4.5",
"grunt-contrib-jshint": "^0.11.0",
"grunt-contrib-jshint": "^1.0.0",
"grunt-contrib-nodeunit": "^0.4.1"
},
"keywords": [
Expand Down
61 changes: 31 additions & 30 deletions tasks/copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,37 @@ module.exports = function(grunt) {
noProcess: options.noProcess || options.processContentExclude
};

var detectDestType = function(dest) {
if (grunt.util._.endsWith(dest, '/')) {
return 'directory';
} else {
return 'file';
}
};

var unixifyPath = function(filepath) {
if (isWindows) {
return filepath.replace(/\\/g, '/');
} else {
return filepath;
}
};

var syncTimestamp = function (src, dest) {
var stat = fs.lstatSync(src);
if (path.basename(src) !== path.basename(dest)) {
return;
}

if (stat.isFile() && !fileSyncCmp.equalFiles(src, dest)) {
return;
}

var fd = fs.openSync(dest, isWindows ? 'r+' : 'r');
fs.futimesSync(fd, stat.atime, stat.mtime);
fs.closeSync(fd);
};

var isExpandedPair;
var dirs = {};
var tally = {
Expand Down Expand Up @@ -94,34 +125,4 @@ module.exports = function(grunt) {
grunt.log.writeln();
});

var detectDestType = function(dest) {
if (grunt.util._.endsWith(dest, '/')) {
return 'directory';
} else {
return 'file';
}
};

var unixifyPath = function(filepath) {
if (isWindows) {
return filepath.replace(/\\/g, '/');
} else {
return filepath;
}
};

var syncTimestamp = function (src, dest) {
var stat = fs.lstatSync(src);
if (path.basename(src) !== path.basename(dest)) {
return;
}

if (stat.isFile() && !fileSyncCmp.equalFiles(src, dest)) {
return;
}

var fd = fs.openSync(dest, isWindows ? 'r+' : 'r');
fs.futimesSync(fd, stat.atime, stat.mtime);
fs.closeSync(fd);
};
};
6 changes: 4 additions & 2 deletions test/copy_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ exports.copy = {

modeDir: function(test) {
test.expect(2);
// on windows DIRs do not have 'executable' flag, see: https://github.com/nodejs/node/blob/master/deps/uv/src/win/fs.c#L1064
// on Windows DIRs do not have 'executable' flag, see
// https://github.com/nodejs/node/blob/master/deps/uv/src/win/fs.c#L1064
var expectedMode = isWindows ? '666' : '777';
test.equal(fs.lstatSync('tmp/copy_test_modeDir/time_folder').mode.toString(8).slice(-3), expectedMode);
test.equal(fs.lstatSync('tmp/copy_test_modeDir/time_folder/sub_folder').mode.toString(8).slice(-3), expectedMode);
Expand All @@ -82,7 +83,8 @@ exports.copy = {

timestamp_equal: function(test) {
if (isWindows) {
// Known Issue: this test will not pass on Windows due to bug in nodejs (https://github.com/nodejs/node/issues/2069)
// Known Issue: this test will not pass on Windows due to a bug in node.js
// https://github.com/nodejs/node/issues/2069
test.done();
return;
}
Expand Down

0 comments on commit 16b2852

Please sign in to comment.