On Thu, Oct 18, 2007 at 02:57:56PM -0400, Alan D. Salewski spake thus:
> Below is a modded version of the quick and dirty 'mvn-clear-snapshots'
> script I have for clearing out SNAPSHOT artifacts for the project I'm
> currently working on. I typically run it prior to performing my first
> build of the day (the version I actually use decends only into the
> directory structure for the project I'm working on).
>
> This isn't as smart as the hypothetical one that Wayne suggests (mine
> doesn't keep the latest version around). But if you know that someone (or
> something) can be counted on to deploy a snapshot build before too long,
> anyway, maybe it will work "good enough" for you.
>
> -Al
>
> ----------------------------------8<-----------------------------------
> #!/bin/sh
>
> set -x
>
> M2_REPO_PATH="${HOME}/.m2/repository"
> if ( find "${M2_REPO_PATH}" -type d -name '*SNAPSHOT*' > /dev/null 2>&1 );
> then
> find "${M2_REPO_PATH}" -type d -name '*SNAPSHOT*' -print0 | \
> xargs --null -I '{}' rm -vfr {}
> fi
> ----------------------------------8<-----------------------------------
Upon reflection, it seems that the version I've been using is more
complicated (and slower) than necessary. Don't know why it was written
that way; probably settled that way after removing other excessive
functionality.
Anyway, here's a simpler version:
----------------------------------8<-----------------------------------
#!/bin/sh
set -x
M2_REPO_PATH="${HOME}/.m2/repository"
find "${M2_REPO_PATH}" -type d -name '*SNAPSHOT*' -print0 | \
xargs --null -I '{}' rm -vfr '{}'
----------------------------------8<-----------------------------------
--
:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::
::
Alan D. Salewski
Software Developer
Health Market Science, Inc.
:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::
::
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]