No offense taken. I'm new to Groovy/Grails (only started looking at it
in the last 48 hours). Still battling with Gant to try and get it to
function as per the examples I've seen (having issues with
${pluginBasedir} & ${basedir} ATM, don't seem to be populating.)
So with the inability to provide something more elegant, I figured I'd
offer something that at least worked.
Thanks for the more elegant solution Marc. :)
Leigh.
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Marc Guillemot
Sent: Tuesday, 12 February 2008 1:46 AM
To: [email protected]
Subject: Re: [Webtest] restrict the number of webtest result backups
(Leigh Fort)
Willi Kuhnis wrote:
> Hi Leigh,
>
> thanks for the MSDOS Batch script.
> I tried it with Groovy for some hours, and I still think, it should be
> possible very easy, but I still couldnt make it running.
>
> But with your DOS Batch it works very nice.
> I call it now with <exec> it it runs perfectly.
>
> Thanks for your help !
>
>
I can't let a ugly (sorry Leigh, this is not your fault, I just don't
like dos) dos script win here ;-)
What about something like that:
<groovyScript>
def nbFilesToKeep = 10
def dir = new File(project.properties['resultFolder'])
def files = dir.listFiles().toList()
files.sort { it.name }
if (files.size() > nbFilesToKeep)
{
def filesToDelete = files[0..(files.size() - nbFilesToKeep - 1)]
def ant = new AntBuilder(project)
filesToDelete.each {
ant.delete(dir: it.absolutePath)
}
}
</groovyScript>
Cheers,
Marc.
--
Blog: http://mguillem.wordpress.com
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest