Skip to content

Commit

Permalink
Documented examples for using no-write
Browse files Browse the repository at this point in the history
  • Loading branch information
JKVeganAbroad committed Jan 22, 2016
1 parent b59c4cc commit c77e0a0
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 1 deletion.
35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,39 @@ 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`.

####### All tasks

```js
// Prevents all targets from deleting any files
clean: {
options: {
'no-write': true
},
build: ['dev/build'],
release: ['dist']
}
```

####### Per-target

```js
// Will delete files for `build` target
// Will NOT delete files for `release` target
clean: {
build: ['dev/build'],
release: {
options: {
'no-write': true
},
src: ['dist']
}
}
```


## Release History

Expand All @@ -105,4 +138,4 @@ which help you deal with hidden files, process dynamic mappings and so on.

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

*This file was generated on Fri Jan 22 2016 11:09:53.*
*This file was generated on Fri Jan 22 2016 11:11:40.*
33 changes: 33 additions & 0 deletions docs/clean-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,36 @@ 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`.

##### All tasks

```js
// Prevents all targets from deleting any files
clean: {
options: {
'no-write': true
},
build: ['dev/build'],
release: ['dist']
}
```

##### Per-target

```js
// Will delete files for `build` target
// Will NOT delete files for `release` target
clean: {
build: ['dev/build'],
release: {
options: {
'no-write': true
},
src: ['dist']
}
}
```

0 comments on commit c77e0a0

Please sign in to comment.