SYNOPSIS

    In your dist.ini:

     [ShareDir]
    
     [ShareDir::Clean]
     ;dir=share
     ;clean_tarball=1

DESCRIPTION

    This plugin is an alternative to using
    Dist::Zilla::Plugin::ShareDir::Tarball (please read the documentation
    of that module first for the rationale). With this plugin, you can keep
    using Dist::Zilla::Plugin::ShareDir, but eliminate the problem of
    lingering old files.

    What this plugin does is search for old shared files (currently the
    only method used is by performing a git log --numstat on your
    repository and comparing the files to what is currently in the working
    directory). A section will then be added to the generated Makefile.PL
    to remove the old files during installation.

    Some caveats/current limitations:

      * Your project must use git.

      * Only Makefile.PL is currently supported.

      * Windows (or other non-POSIX) build system is not yet supported.
      Patches welcome.

      Path separator assumed to be /. Besides, I don't know yet what git
      log uses for path separator on those systems.

      * Windows (or other non-POSIX) installation target system is not yet
      supported. Patches welcome.

      The commands in the generated Makefile.PL is currently Unix-style
      (shell quoting style, use of rm command, ...).

      * When user downgrades, files from newer version won't be deleted.

    All in all, I think Yanick's ShareDir::Tarball plugin is a slightly
    more elegant hack and I use it. But when it's more appropriate, I use
    this plugin too.

CONFIGURATION

 dir => str (default: share)

    Name of shared directory.

 clean_tarball => bool (default: 1)

    If set to 1, will also try to clean shared-files.tar.gz produced by
    Dist::Zilla::Plugin::ShareDir::Tarball.

SEE ALSO

    Dist::Zilla::Plugin::ShareDir

    Dist::Zilla::Plugin::ShareDir::Tarball

