aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhubzilla <git@macgirvin.com>2016-05-19 12:17:19 +1000
committerhubzilla <git@macgirvin.com>2016-05-19 12:17:19 +1000
commit7abb214eaf0061c7cede570e398c3a92b8c874d1 (patch)
tree50e501548895da5e92aaf5e5e28562f7fa39ccc2
parentc17b47518d57de90264378ff082e8a2576bec273 (diff)
parent77eb9bcfa04faee0fbf20a1d9fae90bdf0dcbcc3 (diff)
downloadvolse-hubzilla-7abb214eaf0061c7cede570e398c3a92b8c874d1.tar.gz
volse-hubzilla-7abb214eaf0061c7cede570e398c3a92b8c874d1.tar.bz2
volse-hubzilla-7abb214eaf0061c7cede570e398c3a92b8c874d1.zip
Merge pull request #394 from anaqreon/plugin-link
Link new plugins when updating repos via admin/plugins
-rw-r--r--Zotlabs/Module/Admin.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/Zotlabs/Module/Admin.php b/Zotlabs/Module/Admin.php
index 9b54a4081..cb843e212 100644
--- a/Zotlabs/Module/Admin.php
+++ b/Zotlabs/Module/Admin.php
@@ -1758,6 +1758,18 @@ class Admin extends \Zotlabs\Web\Controller {
$git = new GitRepo('sys', null, false, $repoName, $repoDir);
try {
if ($git->pull()) {
+ $files = array_diff(scandir($repoDir), array('.', '..'));
+ foreach ($files as $file) {
+ if (is_dir($repoDir . '/' . $file) && $file !== '.git') {
+ $source = '../extend/addon/' . $repoName . '/' . $file;
+ $target = realpath(__DIR__ . '/../../addon/') . '/' . $file;
+ unlink($target);
+ if (!symlink($source, $target)) {
+ logger('Error linking addons to /addon');
+ json_return_and_die(array('message' => 'Error linking addons to /addon', 'success' => false));
+ }
+ }
+ }
json_return_and_die(array('message' => 'Repo updated.', 'success' => true));
} else {
json_return_and_die(array('message' => 'Error updating addon repo.', 'success' => false));