Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --include-dotfiles option to allow glob to match files/dirs that begin with '.' #254

Merged
merged 1 commit into from
Dec 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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