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 option to ignore custom files and directories #44

Merged
merged 1 commit into from
Nov 18, 2016
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ You can find a list of all options [below](#options).
| -c, --cache [seconds] | How long static files should be cached in the browser | 3600 |
| -s, --single | Serve single page apps with only one `index.html` in the root directory | - |
| -u, --unzipped | Disable gzip compression | false |
| -i, --ignore | Files and directories to ignore | - |

## Examples

Expand Down
7 changes: 6 additions & 1 deletion bin/list
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ args
.option('cache', 'How long static files should be cached in the browser (seconds)', 3600)
.option('single', 'Serve single page apps with only one index.html')
.option('unzipped', 'Disable GZIP compression')
.option('ignore', 'Files and directories to ignore')

const flags = args.parse(process.argv)
const directory = args.sub[0]
Expand Down Expand Up @@ -62,11 +63,15 @@ const prepareView = () => {
return compile(viewContent)
}

const ignoredFiles = [
let ignoredFiles = [
'.DS_Store',
'.git/'
]

if (flags.ignore.length) {
ignoredFiles = ignoredFiles.concat(flags.ignore.split(','))
}

const renderDirectory = async dir => {
let files = []
const subPath = path.relative(current, dir)
Expand Down