You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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:
The text was updated successfully, but these errors were encountered: