From 70d413ab0412506755bab4878995ab6e99d8e029 Mon Sep 17 00:00:00 2001 From: Andrew Manning Date: Thu, 12 May 2016 06:49:24 -0400 Subject: Create store/git/sys/extend/addon directory and link if it does not exist in all plugin repo GUI POST actions --- Zotlabs/Module/Admin.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Zotlabs/Module/Admin.php b/Zotlabs/Module/Admin.php index e77cf0fc7..9b54a4081 100644 --- a/Zotlabs/Module/Admin.php +++ b/Zotlabs/Module/Admin.php @@ -1733,6 +1733,19 @@ class Admin extends \Zotlabs\Web\Controller { } else { json_return_and_die(array('message' => 'No repo name provided.', 'success' => false)); } + $extendDir = __DIR__ . '/../../store/git/sys/extend'; + $addonDir = $extendDir . '/addon'; + if (!file_exists($extendDir)) { + if (!mkdir($extendDir, 0770, true)) { + logger('Error creating extend folder: ' . $extendDir); + json_return_and_die(array('message' => 'Error creating extend folder: ' . $extendDir, 'success' => false)); + } else { + if (!symlink(__DIR__ . '/../../extend/addon', $addonDir)) { + logger('Error creating symlink to addon folder: ' . $addonDir); + json_return_and_die(array('message' => 'Error creating symlink to addon folder: ' . $addonDir, 'success' => false)); + } + } + } $repoDir = __DIR__ . '/../../store/git/sys/extend/addon/' . $repoName; if (!is_dir($repoDir)) { logger('Repo directory does not exist: ' . $repoDir); @@ -1758,6 +1771,19 @@ class Admin extends \Zotlabs\Web\Controller { } else { json_return_and_die(array('message' => 'No repo name provided.', 'success' => false)); } + $extendDir = __DIR__ . '/../../store/git/sys/extend'; + $addonDir = $extendDir . '/addon'; + if (!file_exists($extendDir)) { + if (!mkdir($extendDir, 0770, true)) { + logger('Error creating extend folder: ' . $extendDir); + json_return_and_die(array('message' => 'Error creating extend folder: ' . $extendDir, 'success' => false)); + } else { + if (!symlink(__DIR__ . '/../../extend/addon', $addonDir)) { + logger('Error creating symlink to addon folder: ' . $addonDir); + json_return_and_die(array('message' => 'Error creating symlink to addon folder: ' . $addonDir, 'success' => false)); + } + } + } $repoDir = __DIR__ . '/../../store/git/sys/extend/addon/' . $repoName; if (!is_dir($repoDir)) { logger('Repo directory does not exist: ' . $repoDir); -- cgit v1.2.3