mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-11 21:11:48 +01:00
UNC paths for plugins
This commit is contained in:
@@ -4,7 +4,6 @@ extern crate core;
|
||||
extern crate objc;
|
||||
|
||||
use std::collections::HashMap;
|
||||
use std::env::current_dir;
|
||||
use std::fs;
|
||||
use std::fs::{create_dir_all, read_to_string, File};
|
||||
use std::path::PathBuf;
|
||||
|
||||
@@ -105,7 +105,11 @@ async fn read_plugins_dir(dir: &PathBuf) -> Result<Vec<String>> {
|
||||
let mut dirs: Vec<String> = vec![];
|
||||
while let Ok(Some(entry)) = result.next_entry().await {
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user