Instead of having exercises in their own separate section, they are now part of the main topics sections. This should make the learning process easier to follow where users have both exercises and questions in the same place. In addition, added a couple of new questions & exercises and modified existing scripts accordingly.
		
			
				
	
	
		
			17 lines
		
	
	
		
			437 B
		
	
	
	
		
			Groovy
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			437 B
		
	
	
	
		
			Groovy
		
	
	
	
	
	
def removeOldBuilds(buildDirectory, days = 14) {
 | 
						|
 | 
						|
  def wp = new File("${buildDirectory}")
 | 
						|
  def currentTime = new Date()
 | 
						|
  def backTime = currentTime - days
 | 
						|
 | 
						|
  wp.list().each { fileName ->
 | 
						|
      folder = new File("${buildDirectory}/${fileName}")
 | 
						|
      if (folder.isDirectory()) {
 | 
						|
          def timeStamp = new Date(folder.lastModified())
 | 
						|
          if (timeStamp.before(backTime)) {
 | 
						|
            folder.delete()
 | 
						|
          }
 | 
						|
      }
 | 
						|
  }
 | 
						|
}
 |