Skip to content

Commit

Permalink
Add --include-dotfiles option to allow glob to match files/dirs that …
Browse files Browse the repository at this point in the history
…begin with '.' (#254)
  • Loading branch information
Ryan Garant authored and RyanZim committed Dec 20, 2018
1 parent ca69641 commit cd6014b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
17 changes: 9 additions & 8 deletions README.md
Expand Up @@ -30,14 +30,15 @@ Usage:
postcss <input.css>... [OPTIONS] --replace
Basic options:
-o, --output Output file [string]
-d, --dir Output directory [string]
-r, --replace Replace (overwrite) the input file [boolean]
--map, -m Create an external sourcemap
--no-map Disable the default inline sourcemaps
--verbose Be verbose [boolean]
--watch, -w Watch files for changes and recompile as needed [boolean]
--env A shortcut for setting NODE_ENV [string]
-o, --output Output file [string]
-d, --dir Output directory [string]
-r, --replace Replace (overwrite) the input file [boolean]
--map, -m Create an external sourcemap
--no-map Disable the default inline sourcemaps
--verbose Be verbose [boolean]
--watch, -w Watch files for changes and recompile as needed [boolean]
--env A shortcut for setting NODE_ENV [string]
--include-dotfiles Enables glob to match files/dirs that begin with "." [boolean]
Options for when not using a config file:
-u, --use List of postcss plugins to use [array]
Expand Down
5 changes: 4 additions & 1 deletion index.js
Expand Up @@ -53,7 +53,10 @@ Promise.resolve()
if (argv.watch && !(argv.output || argv.replace || argv.dir)) {
error('Cannot write to stdout in watch mode')
}
if (input && input.length) return globber(input)

if (input && input.length) {
return globber(input, { dot: argv.includeDotfiles })
}

if (argv.replace || argv.dir) {
error(
Expand Down
4 changes: 4 additions & 0 deletions lib/args.js
Expand Up @@ -58,6 +58,10 @@ Usage:
type: 'boolean',
conflicts: ['output', 'dir']
})
.option('include-dotfiles', {
desc: 'Enables glob to match files/dirs that begin with "."',
type: 'boolean'
})
.alias('map', 'm')
.describe('map', 'Create an external sourcemap')
.describe('no-map', 'Disable the default inline sourcemaps')
Expand Down

0 comments on commit cd6014b

Please sign in to comment.