From ef3f16be9f46eea9baf2e508680961f7fc545002 Mon Sep 17 00:00:00 2001 From: evpeople Date: Wed, 29 Jan 2025 16:18:08 +0800 Subject: [PATCH] fix(plugin): validate plugin path existence before file create Previously, the deployment logic did not verify the existence of the plugin repository path before attempting to create files. This could lead to redundant file creation operations when the plugin path was invalid. - Add pre-check for plugin directory existence - Fail early when plugin path is not found Fixes #1763 --- yazi-cli/src/package/deploy.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/yazi-cli/src/package/deploy.rs b/yazi-cli/src/package/deploy.rs index 4e92dcfb..7068932c 100644 --- a/yazi-cli/src/package/deploy.rs +++ b/yazi-cli/src/package/deploy.rs @@ -12,6 +12,11 @@ impl Dependency { let from = self.local().join(&self.child); self.header("Deploying package `{name}`")?; + // TODO: maybe need to be removed + let plugin_exists = maybe_exists(&from).await; + if !plugin_exists { + bail!("Plugin `{}` not found", self.name); + } self.is_flavor = maybe_exists(&from.join("flavor.toml")).await; let to = self.target();