Skip to content

Commit cd6014b

Browse files
Ryan GarantRyanZim
authored andcommitted
Add --include-dotfiles option to allow glob to match files/dirs that begin with '.' (#254)
1 parent ca69641 commit cd6014b

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,15 @@ Usage:
3030
postcss <input.css>... [OPTIONS] --replace
3131
3232
Basic options:
33-
-o, --output Output file [string]
34-
-d, --dir Output directory [string]
35-
-r, --replace Replace (overwrite) the input file [boolean]
36-
--map, -m Create an external sourcemap
37-
--no-map Disable the default inline sourcemaps
38-
--verbose Be verbose [boolean]
39-
--watch, -w Watch files for changes and recompile as needed [boolean]
40-
--env A shortcut for setting NODE_ENV [string]
33+
-o, --output Output file [string]
34+
-d, --dir Output directory [string]
35+
-r, --replace Replace (overwrite) the input file [boolean]
36+
--map, -m Create an external sourcemap
37+
--no-map Disable the default inline sourcemaps
38+
--verbose Be verbose [boolean]
39+
--watch, -w Watch files for changes and recompile as needed [boolean]
40+
--env A shortcut for setting NODE_ENV [string]
41+
--include-dotfiles Enables glob to match files/dirs that begin with "." [boolean]
4142
4243
Options for when not using a config file:
4344
-u, --use List of postcss plugins to use [array]

index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ Promise.resolve()
5353
if (argv.watch && !(argv.output || argv.replace || argv.dir)) {
5454
error('Cannot write to stdout in watch mode')
5555
}
56-
if (input && input.length) return globber(input)
56+
57+
if (input && input.length) {
58+
return globber(input, { dot: argv.includeDotfiles })
59+
}
5760

5861
if (argv.replace || argv.dir) {
5962
error(

lib/args.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ Usage:
5858
type: 'boolean',
5959
conflicts: ['output', 'dir']
6060
})
61+
.option('include-dotfiles', {
62+
desc: 'Enables glob to match files/dirs that begin with "."',
63+
type: 'boolean'
64+
})
6165
.alias('map', 'm')
6266
.describe('map', 'Create an external sourcemap')
6367
.describe('no-map', 'Disable the default inline sourcemaps')

0 commit comments

Comments
 (0)