Created
December 15, 2013 04:14
-
-
Save lifuzu/7968787 to your computer and use it in GitHub Desktop.
Renaming files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Renaming files using regular expressions | |
task rename(type: Copy) { | |
from 'source' | |
into 'dest' | |
rename(/file-template-(\d+)/, 'production-file-$1.txt') | |
} | |
//Renaming files programmatically | |
task rename(type: Copy) { | |
from 'source' | |
into 'dest' | |
rename { fileName -> | |
"production-file${(fileName - 'file-template')}" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment