markdown-styles icon indicating copy to clipboard operation
markdown-styles copied to clipboard

File contents deleted

Open welchr opened this issue 7 years ago • 1 comments

I ran this rather naively today in a directory and noticed it copying non-markdown files to themselves, which seemed odd, so I hit CTRL+C to stop and take a look. It had deleted the contents of all files it had a chance to access before I stopped it with CTRL+C and left them with 0 filesize. Luckily the files were checked into git and I was able to retrieve them with a quick reset, but this seems like a rather scary issue.

The command I ran was:

generate-md --input . --output . --style github

The current directory had a few markdown files to convert, but subdirectories underneath had code files.

Entirely possible that I read the documentation incorrectly. In general though you probably don't want to modify existing files in the --input directory or any of its subdirectories.

welchr avatar Jun 15 '17 18:06 welchr

ahh good point, the intent is that the directories in --input and --output are different - e.g. rendering a git repo to a folder that will then be pushed to a s3 bucket

should add a check that --input and --output are not the same folder!

mixu avatar Jun 15 '17 21:06 mixu