Skip to content

Commit

Permalink
Remove backwards compatibility for local plugin id
Browse files Browse the repository at this point in the history
  • Loading branch information
Exidex committed Aug 3, 2024
1 parent 5bba73e commit 8c65c16
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions rust/server/src/plugins/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,10 @@ impl PluginLoader {
pub async fn save_local_plugin(&self, path: &str) -> anyhow::Result<PluginId> {
let path = PathBuf::from(path);

let file_name = path.file_name().ok_or(anyhow!("unable to get file name"))?;

let path = if file_name == "dist" {
path
.into_os_string()
.into_string()
.map_err(|_| anyhow!("non uft8 paths are not supported"))?
} else {
path
.join("dist")
.into_os_string()
.into_string()
.map_err(|_| anyhow!("non uft8 paths are not supported"))?
};
let path = path
.into_os_string()
.into_string()
.map_err(|_| anyhow!("non uft8 paths are not supported"))?;

let plugin_id = PluginId::from_string(format!("file://{}", &path));
let plugin_dir = plugin_id.try_to_path()?;
Expand Down

0 comments on commit 8c65c16

Please sign in to comment.