copy-files-from-to
Advanced tools
Comparing version 3.7.0 to 3.8.0
#!/usr/bin/env node | ||
// To debug: | ||
// $ node --inspect-brk ./index.js --config test/<test-name>/copy-files-from-to.json | ||
var path = require('path'), | ||
@@ -4,0 +7,0 @@ fs = require('fs'); |
16
main.js
@@ -254,3 +254,7 @@ var path = require('path'), | ||
}()), | ||
to: unixify(path.join(configFileSourceDirectory, to)), | ||
to: ( | ||
(to.charAt(to.length - 1) === '/') ? | ||
unixify(path.join(configFileSourceDirectory, to)) + '/' : | ||
unixify(path.join(configFileSourceDirectory, to)) | ||
), | ||
toFlat: toFlat, | ||
@@ -383,2 +387,12 @@ removeSourceMappingURL: removeSourceMappingURL, | ||
copyFiles = copyFiles.map((copyFile) => { | ||
if ( | ||
copyFile.to.charAt(copyFile.to.length - 1) === '/' && | ||
!isGlob(copyFile.intendedFrom) | ||
) { | ||
copyFile.to = path.join(copyFile.to, path.basename(copyFile.from)); | ||
} | ||
return copyFile; | ||
}); | ||
var writeContents = function (copyFile, options, cb) { | ||
@@ -385,0 +399,0 @@ var to = copyFile.to, |
{ | ||
"name": "copy-files-from-to", | ||
"version": "3.7.0", | ||
"version": "3.8.0", | ||
"description": "Copy files from one path to another, based on the instructions provided in a configuration file.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -138,2 +138,8 @@ # copy-files-from-to | ||
// Copy the file at the mentioned path into the target directory | ||
{ | ||
"from": "src/app/images/favicon.ico", | ||
"to": "public/" | ||
}, | ||
// Copy the files matching the "glob" pattern (matching files, along with the their folder structure go into the "to" directory) | ||
@@ -140,0 +146,0 @@ { |
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
69505
923
456