Middleman build --dirty : Or how to not remove existing files in build folder

Hey all. Right now I have a git repo in my build directory with a Readme.md. When I run middleman build it get’s removed since the Readme.md file is only in the build directory not the source. If I put the Readme in the source directory, and run middleman build, it will get converted to Readme.html which isn’t what I want either.

The goal is to have files a couple files (Readme and License) that are only in the build directory and don’t get removed when running the build command. Or to have them in the source directory and preserve the .md extension instead of converting to html like all the other markdown files.

Any help would be greatly appreciated.

You can skip removing files in the build directory at the end of the build by using the --no-clean option:

bundle exec middleman build --no-clean

Awesome. Thanks Aupajo!

1 Like