AvianFlu/ncp — pull request #61 by iwege (2014-09-25 14:43:26+00:00)
Title: Fixed bugs relate to  prevent copying to itself. 

I try to fix the issue #60, If I missed something , please let me know.

This PR refactoring the `startsWith` function and try to handle more situations. I add more testcases to test the different situations. ** Some testcases can't used in Windows** :

1. **Copy to sub-folder**
1. `src` to `src`/out
2. **Copy to itself**
1. `src` to `src`
3. **Copy to the folder starts with `src`**
1. `src` to `src_out`
4. **Copy to the symlink folder**
1. `src` to `src-symlink`
5. **Copy the file to itself**
1. `src`/a to `src`/a
6. **More complex situations**:
1. `src` to `src`/`src`_out
2. `src` to `src`_out/`src`

And I add mkdirp to devDependencies to create the directory easily.