Comparing version 2.1.0 to 3.0.0
@@ -17,2 +17,8 @@ #!/usr/bin/env node | ||
var keys = Object.keys(data) | ||
var copyFilesAsNamed = data.copyAsNamed | ||
if (copyFilesAsNamed) { | ||
delete data.copyAsNamed | ||
} else { | ||
copyFilesAsNamed = [] | ||
} | ||
@@ -31,3 +37,8 @@ // needed for the path replacing to work | ||
.on('file', function (file) { | ||
var relativePath = path.relative(source, file).replace(/^__/, '.') | ||
var relativePath | ||
if (copyFilesAsNamed.includes(path.basename(file))) { | ||
relativePath = path.relative(source, file) | ||
} else { | ||
relativePath = path.relative(source, file).replace(/^__/, '.') | ||
} | ||
var destFile = path.join(dest, relativePath) | ||
@@ -34,0 +45,0 @@ |
{ | ||
"name": "generify", | ||
"version": "2.1.0", | ||
"version": "3.0.0", | ||
"description": "A reusable project generator", | ||
@@ -33,3 +33,3 @@ "main": "generify.js", | ||
"standard": "^11.0.0", | ||
"tap": "^11.1.1" | ||
"tap": "^12.0.0" | ||
}, | ||
@@ -39,5 +39,5 @@ "dependencies": { | ||
"pump": "^3.0.0", | ||
"split2": "^0.2.1", | ||
"split2": "^2.0.0", | ||
"walker": "^1.0.6" | ||
} | ||
} |
@@ -49,2 +49,7 @@ # generify [![Build Status](https://travis-ci.org/mcollina/generify.svg?branch=master)](https://travis-ci.org/mcollina/generify) | ||
If the supplied `data` has a key `copyAsNamed`, with an array of names, then | ||
the filenames in that list will not be processed through this rule. Each file | ||
name in the list should not include a path, | ||
e.g. `['__do-not-replace-underscores.js']`. | ||
## Executable | ||
@@ -51,0 +56,0 @@ |
@@ -65,2 +65,6 @@ 'use strict' | ||
if (fixture === 'init') { | ||
data.copyAsNamed = ['__init__.py'] | ||
} | ||
var expectedSet = new Set(Object.keys(expected).map(f => f.replace(/^\//, ''))) | ||
@@ -67,0 +71,0 @@ |
@@ -65,2 +65,6 @@ 'use strict' | ||
if (fixture === 'init') { | ||
data.copyAsNamed = ['__init__.py'] | ||
} | ||
generify(path.join(base, fixture), dest, data, function (err) { | ||
@@ -67,0 +71,0 @@ t.notOk(err, 'no error') |
Sorry, the diff of this file is not supported yet
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
10882
19
249
69
+ Addedisarray@1.0.0(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedsplit2@2.2.0(transitive)
+ Addedstring_decoder@1.1.1(transitive)
+ Addedthrough2@2.0.5(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
- Removedisarray@0.0.1(transitive)
- Removedreadable-stream@1.0.34(transitive)
- Removedsplit2@0.2.1(transitive)
- Removedstring_decoder@0.10.31(transitive)
- Removedthrough2@0.6.5(transitive)
Updatedsplit2@^2.0.0