Skip to content

AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.

fix(desktop): accept the share-extension sign hook in electron-builder

tianma-ifd2a974a68c8d
diff --git a/apps/desktop/electron-builder.yml b/apps/desktop/electron-builder.yml
index b0b38a31..6db32c3c 100644
--- a/apps/desktop/electron-builder.yml
+++ b/apps/desktop/electron-builder.yml
@@ -50,11 +50,13 @@ extraResources:
filter:
- edgeever-sidecar
- edgeever-sidecar.exe
+# Top-level hook. electron-builder rejects afterSign under mac, and the
+# script itself returns immediately on Windows and Linux.
+afterSign: ./scripts/sign-share-extension.cjs
mac:
category: public.app-category.productivity
icon: assets/icon.icns
minimumSystemVersion: "13.0"
- afterSign: ./scripts/sign-share-extension.cjs
extraFiles:
- from: share-extension/dist/EdgeEverShare.appex
to: PlugIns/EdgeEverShare.appex
diff --git a/crates/desktop-sidecar/src/catalog.rs b/crates/desktop-sidecar/src/catalog.rs
index 585dcf98..a27c2ba2 100644
--- a/crates/desktop-sidecar/src/catalog.rs
+++ b/crates/desktop-sidecar/src/catalog.rs
@@ -99,7 +99,10 @@ struct ActiveNotebook {
slug: Option<String>,
}
-fn active_notebook_tree(database: &Connection, notebook_id: &str) -> Result<Vec<ActiveNotebook>, String> {
+fn active_notebook_tree(
+ database: &Connection,
+ notebook_id: &str,
+) -> Result<Vec<ActiveNotebook>, String> {
let mut statement = database
.prepare(
"WITH RECURSIVE tree(id, depth) AS (
@@ -125,7 +128,8 @@ fn active_notebook_tree(database: &Connection, notebook_id: &str) -> Result<Vec<
})
})
.map_err(|e| e.to_string())?;
- rows.collect::<Result<Vec<_>, _>>().map_err(|e| e.to_string())
+ rows.collect::<Result<Vec<_>, _>>()
+ .map_err(|e| e.to_string())
}
pub(crate) fn delete_notebook(database: &Connection, params: &Value) -> Result<Value, String> {
@@ -159,7 +163,10 @@ pub(crate) fn delete_notebook(database: &Connection, params: &Value) -> Result<V
}
return Ok(json!({ "ok": true }));
}
- if tree.iter().any(|notebook| is_inbox_notebook(&notebook.id, notebook.slug.as_deref())) {
+ if tree
+ .iter()
+ .any(|notebook| is_inbox_notebook(&notebook.id, notebook.slug.as_deref()))
+ {
return Err("inbox_not_deletable".to_owned());
}
@@ -185,7 +192,9 @@ pub(crate) fn delete_notebook(database: &Connection, params: &Value) -> Result<V
}
let ids: Vec<String> = tree.iter().map(|notebook| notebook.id.clone()).collect();
- let tx = database.unchecked_transaction().map_err(|e| e.to_string())?;
+ let tx = database
+ .unchecked_transaction()
+ .map_err(|e| e.to_string())?;
for id in &ids {
tx.execute(
"UPDATE notebooks