diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2017-12-14 09:50:31 +0100 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2017-12-14 09:50:31 +0100 |
commit | cca874435027be607f0ec76bc31e8bb80463779c (patch) | |
tree | d311089dd110987ce39c53eb1d97c8fce6ad2c59 /lib/private/Installer.php | |
parent | ce12763ab7e29d8b41ef1b0594923f7911decea9 (diff) | |
download | nextcloud-server-cca874435027be607f0ec76bc31e8bb80463779c.tar.gz nextcloud-server-cca874435027be607f0ec76bc31e8bb80463779c.zip |
Do not update apps if it comes from git
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'lib/private/Installer.php')
-rw-r--r-- | lib/private/Installer.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/private/Installer.php b/lib/private/Installer.php index 48bd57f4c10..3ddef99c645 100644 --- a/lib/private/Installer.php +++ b/lib/private/Installer.php @@ -399,6 +399,10 @@ class Installer { $apps = $this->appFetcher->get(); } + if ($this->isInstalledFromGit($appId) === true) { + return false; + } + foreach($apps as $app) { if($app['id'] === $appId) { $currentVersion = OC_App::getAppVersion($appId); @@ -415,6 +419,22 @@ class Installer { } /** + * Check if app has been installed from git + * @param string $name name of the application to remove + * @return boolean + * + * The function will check if the path contains a .git folder + */ + private function isInstalledFromGit($appId) { + $app = \OC_App::findAppInDirectories($appId); + if($app === false) { + return false; + } + $basedir = $app['path'].'/'.$appId; + return file_exists($basedir.'/.git/'); + } + + /** * Check if app is already downloaded * @param string $name name of the application to remove * @return boolean |