Skip to content

Commit

Permalink
Merge pull request #258 from ricog/patch-1
Browse files Browse the repository at this point in the history
Add example of using paths relative to `cwd`
  • Loading branch information
XhmikosR committed Feb 24, 2016
2 parents 053e169 + 3a95e08 commit ade2465
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 @@ -131,6 +131,39 @@ $ tree -I node_modules
5 directories, 4 files
```

**Copying without full path:**
```js
copy: {
main: {
expand: true,
cwd: 'src',
src: '**',
dest: 'dest/',
},
},
```

```shell
$ grunt copy
Running "copy:main" (copy) task
Created 2 directories, copied 2 files

Done, without errors.
$ tree -I node_modules
.
├── Gruntfile.js
├── dest
│ ├── a
│ └── subdir
│ └── b
└── src
├── a
└── subdir
└── b

5 directories, 5 files
```

**Flattening the filepath output:**

```js
Expand Down Expand Up @@ -242,4 +275,4 @@ Aborted due to warnings.

Task submitted by [Chris Talkington](http://christalkington.com/)

*This file was generated on Tue Feb 23 2016 15:40:33.*
*This file was generated on Tue Feb 23 2016 15:49:48.*
33 changes: 33 additions & 0 deletions docs/copy-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,39 @@ $ tree -I node_modules
5 directories, 4 files
```

**Copying without full path:**
```js
copy: {
main: {
expand: true,
cwd: 'src',
src: '**',
dest: 'dest/',
},
},
```

```shell
$ grunt copy
Running "copy:main" (copy) task
Created 2 directories, copied 2 files

Done, without errors.
$ tree -I node_modules
.
├── Gruntfile.js
├── dest
│ ├── a
│ └── subdir
│ └── b
└── src
├── a
└── subdir
└── b

5 directories, 5 files
```

**Flattening the filepath output:**

```js
Expand Down

0 comments on commit ade2465

Please sign in to comment.