Skip to content

Commit 51d50c7

Browse files
committed
[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.
1 parent fb7120e commit 51d50c7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

plugins/warp/src/plugin.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,13 @@ fn load_network_container() {
119119
fn plugin_init() -> bool {
120120
Logger::new("WARP").with_level(LevelFilter::Debug).init();
121121

122+
// Create the user signature directory if it does not exist, otherwise we will not be able to write to it.
123+
if !user_signature_dir().exists() {
124+
if let Err(e) = std::fs::create_dir_all(&user_signature_dir()) {
125+
log::error!("Failed to create user signature directory: {}", e);
126+
}
127+
}
128+
122129
// Register our matcher and plugin settings globally.
123130
let mut global_bn_settings = Settings::new();
124131
global_bn_settings.register_group("warp", "WARP");

0 commit comments

Comments
 (0)