===
cmd
===

The cmd recipe runs a command when buildout part is installed or updated. Lets
create a minimal `buildout.cfg` file:

  >>> import os
  >>> installed = join(sample_buildout, 'installed.txt')
  >>> updated = join(sample_buildout, 'updated.txt')
  >>> cmdInstall = 'echo "installed" > %s' % installed
  >>> cmdUpdate = 'echo "updated" > %s' % updated

  >>> write(sample_buildout, 'buildout.cfg',
  ... """
  ... [buildout]
  ... parts = cmd
  ...
  ... [cmd]
  ... recipe = p01.recipe.setup:cmd
  ... command = %s
  ... update = %s
  ... """ % (cmdInstall, cmdUpdate))

  >>> print(system(buildout))
  Generated script '/sample-buildout/bin/buildout'.
  Installing cmd.
  cmd: Running 'echo "installed" > /sample-buildout/installed.txt'

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

  >>> 'installed.txt' in os.listdir(sample_buildout)
  True

  >>> 'updated.txt' in os.listdir(sample_buildout)
  False

  >>> print(system(buildout))
  Updating cmd.
  cmd: Running echo "updated" > /sample-buildout/updated.txt

  >>> 'updated.txt' in os.listdir(sample_buildout)
  True
