Skip to content

Commit

Permalink
Add fix to allow Buddy to run with unaccesible plugin dir
Browse files Browse the repository at this point in the history
  • Loading branch information
donhardman committed Nov 13, 2024
1 parent cda672b commit 358c002
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/Plugin/Pluggable.php
Original file line number Diff line number Diff line change
Expand Up @@ -523,12 +523,16 @@ protected function findPluginDir(): string {
. 'buddy-plugins'
;

if (!is_dir($pluginDir) && !mkdir($pluginDir, 0755, true)) {
throw new Exception(
$this->settings->commonPluginDir
. 'is not writable.'
. ' Ensure the user running searchd has proper permissions to access it.'
);
if (!is_dir($pluginDir)) {
try {
mkdir($pluginDir, 0755, true);
} catch (\Throwable) {
Buddy::info(
$this->settings->commonPluginDir
. ' is not writable.'
. ' Ensure the user running searchd has proper permissions to access it.'
);
}
}

return $pluginDir;
Expand Down

0 comments on commit 358c002

Please sign in to comment.