Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
edfe20b2
"git@developer.sourcefind.cn:chenpangpang/open-webui.git" did not exist on "1ea91f9060cd2990bc151ea2ba26cef7817b1daf"
Commit
edfe20b2
authored
Jun 17, 2024
by
Timothy J. Baek
Browse files
fix
parent
a4748af8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
scripts/prepare-pyodide.js
scripts/prepare-pyodide.js
+10
-6
No files found.
scripts/prepare-pyodide.js
View file @
edfe20b2
...
@@ -24,12 +24,16 @@ async function downloadPackages() {
...
@@ -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
)
{
console
.
log
(
'
Pyodide version mismatch, removing static/pyodide directory
'
);
if
(
pyodideVersion
.
replace
(
'
^
'
,
''
)
!==
pyodidePackageVersion
)
{
await
rmdir
(
'
static/pyodide
'
,
{
recursive
:
true
});
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
'
);
await
pyodide
.
loadPackage
(
'
micropip
'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment