Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Improve mobile unzip

Daniel462e992206d3
diff --git a/kernel/harmony/kernel.go b/kernel/harmony/kernel.go
index 27a0f0e816..18359fb84b 100644
--- a/kernel/harmony/kernel.go
+++ b/kernel/harmony/kernel.go
@@ -135,6 +135,7 @@ func DisableFeature(feature *C.char) {
func Unzip(zipFilePath, destination *C.char) {
if err := gulu.Zip.Unzip(C.GoString(zipFilePath), C.GoString(destination)); nil != err {
logging.LogErrorf("unzip [%s] failed: %s", zipFilePath, err)
+ panic(err)
}
}
diff --git a/kernel/mobile/kernel.go b/kernel/mobile/kernel.go
index 82464507ed..6bb5eeed17 100644
--- a/kernel/mobile/kernel.go
+++ b/kernel/mobile/kernel.go
@@ -293,6 +293,13 @@ func AssetName(name string) string {
return util.AssetName(name, ast.NewNodeID())
}
+func Unzip(zipFilePath, destination string) {
+ if err := gulu.Zip.Unzip(zipFilePath, destination); nil != err {
+ logging.LogErrorf("unzip [%s] failed: %s", zipFilePath, err)
+ panic(err)
+ }
+}
+
func Exit() {
os.Exit(logging.ExitCodeOk)
}