Link new plugins when updating repos via admin/plugins
This commit is contained in:
		| @@ -1758,6 +1758,18 @@ class Admin extends \Zotlabs\Web\Controller { | |||||||
| 				$git = new GitRepo('sys', null, false, $repoName, $repoDir); | 				$git = new GitRepo('sys', null, false, $repoName, $repoDir); | ||||||
| 				try { | 				try { | ||||||
| 					if ($git->pull()) { | 					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)); | 						json_return_and_die(array('message' => 'Repo updated.', 'success' => true)); | ||||||
| 					} else { | 					} else { | ||||||
| 						json_return_and_die(array('message' => 'Error updating addon repo.', 'success' => false)); | 						json_return_and_die(array('message' => 'Error updating addon repo.', 'success' => false)); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user