example42/Example42-tools — pull request #3 by javierbertoli (2014-05-03 16:29:07+00:00)
Title: Fix bug in file renaming routine

Ciao Alessandro, I found that the renaming routine is not working as expected. As it is, if you run

```bash
./module_clone.sh -t minimal42 -n newmod
```
you'll find that files' *CONTENTS* are modified, but files' *NAMES* are not:
```bash
./Example42-tools/module_clone.sh -t minimal42 -n newmod
...
...
find . -name *minimal*
```
gives
```bash
./spec/classes/minimal42_spec.rb
```

The reason is the `find` line you use for file renaming. You can check it mimicking it's behaviour, and you'll see that, as is, just returns one line, the `$NEWMODULE` directory, with no contents.

This patch fixes that. Also added an extra line as, in the uncommon (but possible) case that you rename a directory before its files, weird things can happen :)