Skip to content

Commit

Permalink
Added brief explanation of globbing behaviour patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
JKVeganAbroad committed Jan 22, 2016
1 parent c77e0a0 commit 05b4c22
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 7 deletions.
30 changes: 26 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,31 @@ clean: {
}
```

"Compact" and "Files Array" formats support a few [additional properties](http://gruntjs.com/configuring-tasks#files)
which help you deal with hidden files, process dynamic mappings and so on.

#### Globbing Patterns

Although documented [in the Grunt Docs](http://gruntjs.com/configuring-tasks#globbing-patterns), here are some globbing pattern examples to acheive some common tasks:

```js
clean: {
folder: ['path/to/dir/'],
folder_v2: ['path/to/dir/**'],
contents: ['path/to/dir/*'],
subfolders: ['path/to/dir/*/'],
css: ['path/to/dir/*.css'],
all_css: ['path/to/dir/**/*.css']
}
```

* __`folder`:__ Deletes the `dir/` folder
* __`folder_v2`:__ Deletes the `dir/` folder
* __`contents`:__ Keeps the `dir/` folder, but deletes the contents
* __`subfolders`:__ Keeps the files inside the `dir/` folder, but deletes all subfolders
* __`css`:__ Deletes all `*.css` files inside the `dir/` folder, excluding subfolders
* __`all_css`:__ Deletes all `*.css` files inside the `dir/` folder and its subfolders

##### Skipping Files

```js
Expand All @@ -84,9 +109,6 @@ clean: {
}
```

"Compact" and "Files Array" formats support a few [additional properties](http://gruntjs.com/configuring-tasks#files)
which help you deal with hidden files, process dynamic mappings and so on.

###### Options

Options can be specified for all `clean` tasks and for each `clean:target`.
Expand Down Expand Up @@ -138,4 +160,4 @@ clean: {

Task submitted by [Tim Branyen](http://tbranyen.com/)

*This file was generated on Fri Jan 22 2016 11:11:40.*
*This file was generated on Fri Jan 22 2016 12:07:21.*
28 changes: 25 additions & 3 deletions docs/clean-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,31 @@ clean: {
}
```

"Compact" and "Files Array" formats support a few [additional properties](http://gruntjs.com/configuring-tasks#files)
which help you deal with hidden files, process dynamic mappings and so on.

## Globbing Patterns

Although documented [in the Grunt Docs](http://gruntjs.com/configuring-tasks#globbing-patterns), here are some globbing pattern examples to acheive some common tasks:

```js
clean: {
folder: ['path/to/dir/'],
folder_v2: ['path/to/dir/**'],
contents: ['path/to/dir/*'],
subfolders: ['path/to/dir/*/'],
css: ['path/to/dir/*.css'],
all_css: ['path/to/dir/**/*.css']
}
```

* __`folder`:__ Deletes the `dir/` folder
* __`folder_v2`:__ Deletes the `dir/` folder
* __`contents`:__ Keeps the `dir/` folder, but deletes the contents
* __`subfolders`:__ Keeps the files inside the `dir/` folder, but deletes all subfolders
* __`css`:__ Deletes all `*.css` files inside the `dir/` folder, excluding subfolders
* __`all_css`:__ Deletes all `*.css` files inside the `dir/` folder and its subfolders

### Skipping Files

```js
Expand All @@ -36,9 +61,6 @@ clean: {
}
```

"Compact" and "Files Array" formats support a few [additional properties](http://gruntjs.com/configuring-tasks#files)
which help you deal with hidden files, process dynamic mappings and so on.

#### Options

Options can be specified for all `clean` tasks and for each `clean:target`.
Expand Down

0 comments on commit 05b4c22

Please sign in to comment.