=====
mkdir
=====

The mkdir recipe creates a directory. An important part is, that this recipe
will never remove a created directory. Lets create a minimal `buildout.cfg`
file:


  >>> write(sample_buildout, 'buildout.cfg',
  ... """
  ... [buildout]
  ... parts = data-dir
  ...
  ... [data-dir]
  ... recipe = p01.recipe.setup:mkdir
  ... path = mystuff
  ... """)
  >>> print(system(buildout))
  Installing data-dir.
  data-dir: Creating directory mystuff

  >>> ls(sample_buildout)
  -  .installed.cfg
  d  bin
  -  buildout.cfg
  d  develop-eggs
  d  eggs
  d  mystuff
  d  parts

If we change the directory name the old directory ('mystuff') is not deleted.

  >>> write(sample_buildout, 'buildout.cfg',
  ... """
  ... [buildout]
  ... parts = data-dir
  ...
  ... [data-dir]
  ... recipe = p01.recipe.setup:mkdir
  ... path = otherdir
  ... """)
  >>> print(system(buildout))
  Uninstalling data-dir.
  Installing data-dir.
  data-dir: Creating directory otherdir

  >>> ls(sample_buildout)
  -  .installed.cfg
  d  bin
  -  buildout.cfg
  d  develop-eggs
  d  eggs
  d  mystuff
  d  otherdir
  d  parts

We can also create a full path.

  >>> write(sample_buildout, 'buildout.cfg',
  ... """
  ... [buildout]
  ... parts = data-dir
  ...
  ... [data-dir]
  ... recipe = p01.recipe.setup:mkdir
  ... path = with/subdir
  ... """)
  >>> print(system(buildout))
  Uninstalling data-dir.
  Installing data-dir.
  data-dir: Cannot create /sample-buildout/with/subdir. /sample-buildout/with is not a directory.
  While:
    Installing data-dir.
  Error: Invalid path in p01.recipe.setup:mkdir recipe

But we need to activate this function explicitely.

  >>> write(sample_buildout, 'buildout.cfg',
  ... """
  ... [buildout]
  ... parts = data-dir
  ... find-links = http://download.zope.org/distribution
  ...
  ... [data-dir]
  ... recipe = p01.recipe.setup:mkdir
  ... createpath = True
  ... path = with/subdir
  ... """)
  >>> print(system(buildout))
  Installing data-dir.
  data-dir: Creating directory with/subdir

  >>> ls(sample_buildout)
  -  .installed.cfg
  d  bin
  -  buildout.cfg
  d  develop-eggs
  d  eggs
  d  mystuff
  d  otherdir
  d  parts
  d  with
