add-dist-header
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -34,3 +34,3 @@ #!/usr/bin/env node | ||
// Parameters and flags | ||
const validFlags = ['delimiter', 'keep-first', 'keep', 'no-version', 'note', 'quiet', 'recursive']; | ||
const validFlags = ['delimiter', 'ext', 'keep-first', 'keep', 'no-version', 'note', 'quiet', 'recursive']; | ||
const cli = cliArgvUtil.parse(validFlags); | ||
@@ -62,3 +62,5 @@ const source = cli.params[0] ?? 'build/*'; | ||
const pattern = isFolder ? origin + wildcard : origin; | ||
const filenames = globSync(pattern, { nodir: true }).sort(); | ||
const extensions = cli.flagMap.ext?.split(',') ?? null; | ||
const keep = (filename) => !extensions || extensions.includes(path.extname(filename)); | ||
const filenames = globSync(pattern, { nodir: true }).filter(keep).sort(); | ||
const error = | ||
@@ -65,0 +67,0 @@ cli.invalidFlag ? cli.invalidFlagMsg : |
@@ -1,2 +0,2 @@ | ||
//! add-dist-header v1.2.0 ~~ https://github.com/center-key/add-dist-header ~~ MIT License | ||
//! add-dist-header v1.2.1 ~~ https://github.com/center-key/add-dist-header ~~ MIT License | ||
@@ -3,0 +3,0 @@ export type Settings = { |
@@ -1,2 +0,2 @@ | ||
//! add-dist-header v1.2.0 ~~ https://github.com/center-key/add-dist-header ~~ MIT License | ||
//! add-dist-header v1.2.1 ~~ https://github.com/center-key/add-dist-header ~~ MIT License | ||
@@ -3,0 +3,0 @@ import { isBinary } from 'istextorbinary'; |
{ | ||
"name": "add-dist-header", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Prepend a one-line banner comment (with license notice) to distribution files", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -77,2 +77,3 @@ # Add Dist Header | ||
| `--delimiter` | Characters separating the parts of the header<br>comment. | **string** | `~~` | | ||
| `--ext` | Filter files by file extension, such as `.js`.<br>Use a comma to specify multiple extensions. | **string** | N/A | | ||
| `--keep-first` | Do not delete the original first line comment. | N/A | N/A | | ||
@@ -98,4 +99,4 @@ | `--no-version` | Do not substitute occurrences of `{{pkg.version}}`<br>with the **package.json** version number. | N/A | N/A | | ||
- `add-dist-header build dist --recursive`<br> | ||
Include the subfolders of **build**. | ||
- `add-dist-header build dist --ext=.js,.css --recursive`<br> | ||
Process only JavaScript and CSS files in the **build** folder and its subfolders. | ||
@@ -102,0 +103,0 @@ ## C) Application Code |
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
17694
168
134