mirror of https://github.com/jruby-gradle/jem
Only attempt to copy the bindir if it actually exists in our data.tar.gz
In commons-vfs 2.1-SNAPSHOT it appears that .getChild() is returning null instead of raising a FileNotFoundException when the bindir isn't present. I might be referring to outdated docs, but this resolves the issue and makes sure there are not NPEs raised
This commit is contained in:
parent
b4bfafcb45
commit
767161e069
|
@ -156,13 +156,20 @@ class GemInstaller {
|
|||
|
||||
protected void extractData(File installDir, FileObject dataTarGz, Gem gem) {
|
||||
String dir = "${gem.name}-${gem.version.version}"
|
||||
logger.info("Extracting into ${installDir} from ${gem.name}")
|
||||
FileObject outputDir = fileSystemManager.resolveFile(new File(installDir, 'gems'), dir)
|
||||
outputDir.copyFrom(dataTarGz, new AllFileSelector())
|
||||
outputDir.close()
|
||||
}
|
||||
|
||||
protected void extractExecutables(File installDir, FileObject dataTarGz, Gem gem) {
|
||||
String binDir = gem.bindir ?: 'bin'
|
||||
FileObject binObject = fileSystemManager.resolveFile(installDir, 'bin')
|
||||
binObject.copyFrom(dataTarGz.getChild(gem.bindir), new AllFileSelector())
|
||||
FileObject child = dataTarGz.getChild(binDir)
|
||||
if (!child) {
|
||||
return
|
||||
}
|
||||
binObject.copyFrom(child, new AllFileSelector())
|
||||
binObject.close()
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue