UNC paths for plugins

This commit is contained in:
Gregory Schier
2024-08-09 11:33:54 -07:00
parent 6eb2cbd582
commit 1e9f10a99f
2 changed files with 5 additions and 2 deletions

View File

@@ -4,7 +4,6 @@ extern crate core;
extern crate objc; extern crate objc;
use std::collections::HashMap; use std::collections::HashMap;
use std::env::current_dir;
use std::fs; use std::fs;
use std::fs::{create_dir_all, read_to_string, File}; use std::fs::{create_dir_all, read_to_string, File};
use std::path::PathBuf; use std::path::PathBuf;

View File

@@ -105,7 +105,11 @@ async fn read_plugins_dir(dir: &PathBuf) -> Result<Vec<String>> {
let mut dirs: Vec<String> = vec![]; let mut dirs: Vec<String> = vec![];
while let Ok(Some(entry)) = result.next_entry().await { while let Ok(Some(entry)) = result.next_entry().await {
if entry.path().is_dir() { if entry.path().is_dir() {
dirs.push(entry.path().to_string_lossy().to_string()) // HACK: Remove UNC prefix for Windows paths to pass to sidecar
let safe_path = dunce::simplified(entry.path().as_path())
.to_string_lossy()
.to_string();
dirs.push(safe_path)
} }
} }
Ok(dirs) Ok(dirs)