Skip to content

Commit 4587e30

Browse files
committed
added option to extract all extractable files on startup
1 parent db44e52 commit 4587e30

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

graalpython/org.graalvm.python.embedding/src/org/graalvm/python/embedding/vfs/VirtualFileSystem.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ public final class VirtualFileSystem implements FileSystem, AutoCloseable {
8787
private static final String VENV_PREFIX = "/" + VFS_ROOT + "/" + VFS_VENV;
8888
private static final String HOME_PREFIX = "/" + VFS_ROOT + "/" + VFS_HOME;
8989
private static final String PROJ_PREFIX = "/" + VFS_ROOT + "/" + VFS_PROJ;
90+
private boolean extractOnStartup = "true".equals(System.getProperty("graalpy.vfs.extractOnStartup"));
9091

9192
public static enum HostIO {
9293
NONE,
@@ -464,6 +465,12 @@ private void initEntries() throws IOException {
464465
FileEntry fileEntry = new FileEntry(platformPath);
465466
vfsEntries.put(toCaseComparable(platformPath), fileEntry);
466467
parent.entries.add(fileEntry);
468+
if(extractOnStartup) {
469+
Path p = Paths.get(fileEntry.getPlatformPath());
470+
if (shouldExtract(p)) {
471+
getExtractedPath(p);
472+
}
473+
}
467474
}
468475
}
469476
}

0 commit comments

Comments
 (0)