summaryrefslogtreecommitdiff
path: root/plugins/warp
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2025-11-07 19:18:14 -0500
committerMason Reed <35282038+emesare@users.noreply.github.com>2025-11-16 19:58:11 -0500
commit51d50c76dcd654b7b0ec187593e31f9c38757823 (patch)
treebd036f039d1c8b2962da958e44b3c10ed594269c /plugins/warp
parentfb7120e9d443d5c7fa6dc5145b02367415baa619 (diff)
[WARP] Explicitly create user signature directory on plugin init
Fixes cases where the user signature directory for some reason has not been created, typically the directory will exist as the sigkit runner will also try and create the directory.
Diffstat (limited to 'plugins/warp')
-rw-r--r--plugins/warp/src/plugin.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/warp/src/plugin.rs b/plugins/warp/src/plugin.rs
index 917c849d..f384a6f5 100644
--- a/plugins/warp/src/plugin.rs
+++ b/plugins/warp/src/plugin.rs
@@ -119,6 +119,13 @@ fn load_network_container() {
fn plugin_init() -> bool {
Logger::new("WARP").with_level(LevelFilter::Debug).init();
+ // Create the user signature directory if it does not exist, otherwise we will not be able to write to it.
+ if !user_signature_dir().exists() {
+ if let Err(e) = std::fs::create_dir_all(&user_signature_dir()) {
+ log::error!("Failed to create user signature directory: {}", e);
+ }
+ }
+
// Register our matcher and plugin settings globally.
let mut global_bn_settings = Settings::new();
global_bn_settings.register_group("warp", "WARP");