Skip to content

Commit

Permalink
fix(plugin): validate plugin path existence before file create
Browse files Browse the repository at this point in the history
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 sxyazi#1763
  • Loading branch information
evpeople committed Jan 29, 2025
1 parent 7e427fe commit e76ce7c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions yazi-cli/src/package/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit e76ce7c

Please sign in to comment.