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

mkdocs build cleaning removes .git when site_dir points to a parent directory #346

Closed
ghost opened this issue Feb 14, 2015 · 2 comments
Closed
Labels
Milestone

Comments

@ghost
Copy link

@ghost ghost commented Feb 14, 2015

mkdocs build --clean wipes out the project when attempting to split doc development and mkdocs' build output across two git branches (gh-pages, gh-pages-dev) with the following layout:

<branch: gh-pages-dev>
$PROJ_ROOT/
|- dev
`  |- doc/
   `- mkdoc.yml  \# NOTE: site_dir=../

<branch: gh-pages>
$PROJ_ROOT/
`- ... \# build output

This is so I can both keep everything in the same project and also track the dev/ directory on the dev branch and have the output where it should be on the gh-pages branch. It seems obvious now that this would wipe out everything including the .git/ for the project (glad this was a test). Possibly, it could recursively check site_dir for a .git, warn and exit. Or just a disclaimer here of this possibility would be enough, so no one else tries this and wipes out their project (and maybe you could recommend to new users how to maintain site development and build output in the same repo).

Thanks,
Kris

@d0ugal
Copy link
Member

@d0ugal d0ugal commented Mar 7, 2015

Fair point, I think we shouldn't delete any hidden files or directories, much like we don't copy them from the docs_dir to the build_dir if they are hidden files/directories.

@d0ugal d0ugal added the Bug label Mar 7, 2015
@vkbansal
Copy link

@vkbansal vkbansal commented Mar 22, 2015

+1 for this

@d0ugal d0ugal added this to the 0.12.0 milestone Apr 3, 2015
@d0ugal d0ugal added the Easy label Apr 3, 2015
d0ugal added a commit to d0ugal/mkdocs that referenced this issue Apr 4, 2015
@d0ugal d0ugal closed this in #418 Apr 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants
You can’t perform that action at this time.