diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-06-14 23:01:47 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-06-14 23:01:47 +0300 |
| commit | 3015ce0f9d120df7583f838d1a47cb469fe5a727 (patch) | |
| tree | 94db93e9fa6f7b83e4eb3ab09581ce101d536cfd /src/api/schema/plugins.rs | |
| parent | 001a6b2fc4218d232967f285f945b313ce9ca19a (diff) | |
fix: stabilize plugin config directories
Diffstat (limited to 'src/api/schema/plugins.rs')
| -rw-r--r-- | src/api/schema/plugins.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/api/schema/plugins.rs b/src/api/schema/plugins.rs index be9336c8..907f243b 100644 --- a/src/api/schema/plugins.rs +++ b/src/api/schema/plugins.rs @@ -107,7 +107,7 @@ pub enum PluginSourceKind { pub(crate) fn plugin_managed_path_component(value: &str) -> String { let slug = readable_plugin_path_slug(value); - let hash = short_plugin_id_hash(value); + let hash = short_plugin_id_hash_for_path_component(value); format!("{slug}-{hash}") } @@ -133,14 +133,14 @@ fn readable_plugin_path_slug(value: &str) -> String { } else { slug.chars().take(80).collect() }; - if has_windows_reserved_stem(&slug) { + if has_windows_reserved_stem_for_path_component(&slug) { slug.replace('.', "-") } else { slug } } -fn short_plugin_id_hash(value: &str) -> String { +pub(crate) fn short_plugin_id_hash_for_path_component(value: &str) -> String { use sha2::{Digest, Sha256}; let digest = Sha256::digest(value.as_bytes()); @@ -152,7 +152,7 @@ fn short_plugin_id_hash(value: &str) -> String { hash } -fn has_windows_reserved_stem(value: &str) -> bool { +pub(crate) fn has_windows_reserved_stem_for_path_component(value: &str) -> bool { let stem = value.split('.').next().unwrap_or(value); matches!( stem.to_ascii_uppercase().as_str(), |
