Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jekyll deleted my entire site, source code, git repo, everything :( #902

Closed
kentonv opened this issue Mar 30, 2013 · 2 comments
Closed

Jekyll deleted my entire site, source code, git repo, everything :( #902

kentonv opened this issue Mar 30, 2013 · 2 comments

Comments

@kentonv
Copy link

kentonv commented Mar 30, 2013

So, I was writing a github page, was using Jekyll, and then I needed a custom Pygments lexer. This meant I needed to run Jekyll locally instead of letting github do it. So I move all my code into a subdirectory called "src", go into src, and type "jekyll .." to generate the site back into the root directory. Seemed reasonable.

Except, Jekyll recursively deletes everything in the target directory, including dotfiles, because it just assumes that it generated that data itself. So not only did it delete everything I wrote today, it took the .git directory with it. :(

Very luckily for me, like Wile E. Coyote running of a cliff, Jekyll managed to generate fresh .html files before it noticed that its source directory was gone and crashed out. So most of my text isn't lost, I just have to convert it back from HTML to markdown.

I realize that this was fundamentally user error on my part, but it seems worth doing something to make sure this doesn't happen to someone else, since it's not completely obvious that Jekyll intends to delete anything. Perhaps you could:

  • Refuse "." and ".." as target directories, since no user would ever want to do this.
  • Refuse to generate into a directory containing any dotfiles, especially ".git", because Jekyll certainly didn't generate these.
  • Or maybe, refuse to generate into any directory that exists, unless it is called _site, which can reasonably be assumed to contain the output from a previous run.
@parkr
Copy link
Member

parkr commented Apr 1, 2013

#535 took care of this. :-)

@parkr parkr closed this as completed Apr 1, 2013
@kentonv
Copy link
Author

kentonv commented Apr 1, 2013

Oops, sorry, I guess the Ubuntu package I am running is really old. Thanks!

@jekyll jekyll locked and limited conversation to collaborators Feb 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants