mirror of
https://github.com/open-webui/open-webui
synced 2025-01-18 00:30:51 +00:00
fix
This commit is contained in:
parent
a4748af822
commit
edfe20b2e1
@ -24,12 +24,16 @@ async function downloadPackages() {
|
|||||||
const packageJson = JSON.parse(await readFile('package.json'));
|
const packageJson = JSON.parse(await readFile('package.json'));
|
||||||
const pyodideVersion = packageJson.dependencies.pyodide;
|
const pyodideVersion = packageJson.dependencies.pyodide;
|
||||||
|
|
||||||
const pyodidePackageJson = JSON.parse(await readFile('static/pyodide/package.json'));
|
try {
|
||||||
const pyodidePackageVersion = pyodidePackageJson.version;
|
const pyodidePackageJson = JSON.parse(await readFile('static/pyodide/package.json'));
|
||||||
|
const pyodidePackageVersion = pyodidePackageJson.version;
|
||||||
|
|
||||||
if (pyodideVersion.replace('^', '') !== pyodidePackageVersion) {
|
if (pyodideVersion.replace('^', '') !== pyodidePackageVersion) {
|
||||||
console.log('Pyodide version mismatch, removing static/pyodide directory');
|
console.log('Pyodide version mismatch, removing static/pyodide directory');
|
||||||
await rmdir('static/pyodide', { recursive: true });
|
await rmdir('static/pyodide', { recursive: true });
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log('Pyodide package not found, downloading packages');
|
||||||
}
|
}
|
||||||
|
|
||||||
await pyodide.loadPackage('micropip');
|
await pyodide.loadPackage('micropip');
|
||||||
|
Loading…
Reference in New Issue
Block a user