mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-07 13:38:49 +00:00
Fixed extraction of site plugins downloaded from github, so that we skip the top-level folder and we place the files directly under the _site folder
Closes #3551
This commit is contained in:
parent
fa067e058a
commit
d5b2c8e82f
@ -126,7 +126,7 @@ public class PluginManager {
|
||||
if (elements.length > 2) {
|
||||
version = elements[2];
|
||||
}
|
||||
filterZipName = userName + "-" + repoName;
|
||||
filterZipName = repoName;
|
||||
// the installation file should not include the userName, just the repoName
|
||||
name = repoName;
|
||||
if (name.startsWith("elasticsearch-")) {
|
||||
@ -225,13 +225,13 @@ public class PluginManager {
|
||||
if (zipEntry.isDirectory()) {
|
||||
continue;
|
||||
}
|
||||
String zipName = zipEntry.getName().replace('\\', '/');
|
||||
String zipEntryName = zipEntry.getName().replace('\\', '/');
|
||||
if (filterZipName != null) {
|
||||
if (zipName.startsWith(filterZipName)) {
|
||||
zipName = zipName.substring(zipName.indexOf('/'));
|
||||
if (zipEntryName.startsWith(filterZipName)) {
|
||||
zipEntryName = zipEntryName.substring(zipEntryName.indexOf('/'));
|
||||
}
|
||||
}
|
||||
File target = new File(extractLocation, zipName);
|
||||
File target = new File(extractLocation, zipEntryName);
|
||||
FileSystemUtils.mkdirs(target.getParentFile());
|
||||
Streams.copy(zipFile.getInputStream(zipEntry), new FileOutputStream(target));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user