aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-05-13 09:08:30 +1000
committerredmatrix <git@macgirvin.com>2016-05-13 09:08:30 +1000
commit57273db8a603292500d9d2b34f71454a28836a9d (patch)
tree1402e52cbbb9643f24dfed88e285a8aa1466cbeb
parentac1ec996847235152b61e681ae39d976d3177d4b (diff)
parent70d413ab0412506755bab4878995ab6e99d8e029 (diff)
downloadvolse-hubzilla-57273db8a603292500d9d2b34f71454a28836a9d.tar.gz
volse-hubzilla-57273db8a603292500d9d2b34f71454a28836a9d.tar.bz2
volse-hubzilla-57273db8a603292500d9d2b34f71454a28836a9d.zip
Merge pull request #378 from anaqreon/plugin-init
Create store/git/sys/extend/addon directory and link if it does not e…
-rw-r--r--Zotlabs/Module/Admin.php26
1 files changed, 26 insertions, 0 deletions
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);