This commit is contained in:
Timothy J. Baek 2024-06-17 14:28:56 -07:00
parent a4748af822
commit edfe20b2e1

View File

@ -24,6 +24,7 @@ async function downloadPackages() {
const packageJson = JSON.parse(await readFile('package.json'));
const pyodideVersion = packageJson.dependencies.pyodide;
try {
const pyodidePackageJson = JSON.parse(await readFile('static/pyodide/package.json'));
const pyodidePackageVersion = pyodidePackageJson.version;
@ -31,6 +32,9 @@ async function downloadPackages() {
console.log('Pyodide version mismatch, removing static/pyodide directory');
await rmdir('static/pyodide', { recursive: true });
}
} catch (e) {
console.log('Pyodide package not found, downloading packages');
}
await pyodide.loadPackage('micropip');
const micropip = pyodide.pyimport('micropip');