Simplify filtering of archive contents

This commit is contained in:
Ben Liblit 2018-01-18 18:48:38 -06:00
parent 8303eaba4c
commit c98ea16374
1 changed files with 2 additions and 5 deletions

View File

@ -23,12 +23,9 @@ task verifyNodeJS(type: VerifyWithStamp, dependsOn: downloadNodeJS) {
task unpackNodeJSLib(type: Sync, dependsOn: verifyNodeJS) {
from(zipTree(verifyNodeJS.src)) {
include 'nodejs-node-0a604e9/lib/*'
eachFile {
if (relativePath.pathString.startsWith('nodejs-node-0a604e9/lib/')) {
def renamedRelative = new RelativePath(!directory, 'core-modules', relativePath.lastName)
relativePath = renamedRelative
} else
exclude()
relativePath new RelativePath(!directory, 'core-modules', relativePath.lastName)
}
}