winton / stasis

Static sites made powerful
http://stasis.me
MIT License
679 stars 56 forks source link

stasis deletes all contents of public #15

Closed krainboltgreene closed 8 years ago

krainboltgreene commented 13 years ago

I have a repository:

app/
  .git/
  index.html.haml
  index.css.scss
  public/
    .git/
    index.html
    index.css

Running stasis will delete the .git folder. It should not do this.

boretom commented 12 years ago

Hey @krainboltgreene, how comes that you have a .git directory within another git repository (submodules don't create .git directories AFAIK)

To your question: I had a similar problem and found no way to prevent the output directory from being clean. I tried adding ignore statement to controller.rb but without success.

mark-rushakoff commented 12 years ago

I'm hesitant to post it as a full solution, because it's not clean and not tested -- but I'm using grit to scan my output directory and commit its content to the gh-pages branch in my repo, all as a rake task. I think it also requires that branch to exist before that task will work properly.

But, for me in that repo, this issue is solved. I'm not ready to clean up the code and make a pull request because I'm still uncomfortable using grit and I'm currently unsure how to go about testing that functionality. If anyone else wants to take a look at it using my code as a starting point, please go ahead.

krainboltgreene commented 12 years ago

I had a second git repo in the public directory so that I could push just that directory to my github account website repository.

boretom commented 12 years ago

@krainboltgreene I think you could have solved that with a git submodule

@mark-rushakoff Mmmhh, I could solve it by reorg my little project. I think making the changes in stasis seems more appropriate - if any fix. As I was reading through other issues I now know that the 'public' folder is excluded from ignore ignores.