Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix opening .cap from finder

Brendan Allan6bc14980dbfd
diff --git a/apps/desktop/src-tauri/src/deeplink_actions.rs b/apps/desktop/src-tauri/src/deeplink_actions.rs
index fb0762053..8f84b5dc1 100644
--- a/apps/desktop/src-tauri/src/deeplink_actions.rs
+++ b/apps/desktop/src-tauri/src/deeplink_actions.rs
@@ -81,6 +81,12 @@ impl TryFrom<&Url> for DeepLinkAction {
type Error = ActionParseFromUrlError;
fn try_from(url: &Url) -> Result<Self, Self::Error> {
+ if url.scheme() == "file" {
+ return Ok(Self::OpenEditor {
+ project_path: url.path().into(),
+ });
+ }
+
match url.domain() {
Some(v) if v != "action" => Err(ActionParseFromUrlError::NotAction),
_ => Err(ActionParseFromUrlError::Invalid),
diff --git a/apps/desktop/src-tauri/src/lib.rs b/apps/desktop/src-tauri/src/lib.rs
index 1003710bd..fa53796f3 100644
--- a/apps/desktop/src-tauri/src/lib.rs
+++ b/apps/desktop/src-tauri/src/lib.rs
@@ -79,6 +79,7 @@ use tokio::sync::mpsc;
use tokio::sync::{Mutex, RwLock};
use tracing::debug;
use tracing::error;
+use tracing::trace;
use upload::{S3UploadMeta, create_or_get_video, upload_image, upload_video};
use web_api::ManagerExt as WebManagerExt;
use windows::EditorWindowIds;
@@ -2004,6 +2005,9 @@ pub async fn run(recording_logging_handle: LoggingHandle) {
#[allow(unused_mut)]
let mut builder =
tauri::Builder::default().plugin(tauri_plugin_single_instance::init(|app, args, _cwd| {
+ trace!("Single instance invoked with args {args:?}");
+
+ // This is also handled as a deeplink on some platforms (eg macOS), see deeplink_actions
let Some(cap_file) = args
.iter()
.find(|arg| arg.ends_with(".cap"))