Closed perfusorius closed 12 years ago
I guess, this is feature, not a bug. You can run ndoc
by accident on directory, wich contains significant data in ./doc
subfolder. In this case your data can be destroyed. So, output dir should not exist.
The proper way is to do shell shcript, wich remove ./doc
folder, and then run ndoc
. For example, in *nix: https://github.com/nodeca/fs-tools/blob/master/Makefile#L43
Probably there're 2 separate bugs: improper code in fs-tools
+ improper error detection in ndoc
Yes, I see your point. One should explicitly delete the docs folder before creating docs. Unfortunatley copy_file does also not check if it overwrites a file... Maybe there could be a --force option to force overwrite?
fs-tools.copy must overwrite by design. It was a bug, if it could not do that. We are in progress of code review.
Using NDoc to create HTML documentation I get an error. When it tries to copy the skeleton dir to my target dir, it calls fs.mkdir(dst), which does not test for existence of dst. At least under Windows this throws an error and the copy exits before it's begun. Your method fstools.mkdir on the other hand checks for existence und hence protects from this error. My computer is running Windows 7. I don't know if this problem actually exists in Linux / Mac but I think my solution should not break on any platform. { [Error: EEXIST, file already exists '...\doc'] errno: 47, code: 'EEXIST', path: '...\doc' }