diff --git a/core/class/jeedom.class.php b/core/class/jeedom.class.php index dd8e124502..9c17115b46 100644 --- a/core/class/jeedom.class.php +++ b/core/class/jeedom.class.php @@ -817,7 +817,7 @@ public static function restore($_backup = '', $_background = false) { public static function update($_options = array()) { log::clear('update'); $params = ''; - if (count($_options) > 0) { + if (is_array($_options) && count($_options) > 0) { foreach ($_options as $key => $value) { $params .= '"' . $key . '"="' . $value . '" '; } diff --git a/core/class/system.class.php b/core/class/system.class.php index 24c722df87..0c4747b1a3 100644 --- a/core/class/system.class.php +++ b/core/class/system.class.php @@ -424,7 +424,10 @@ public static function checkAndInstall($_packages, $_fix = false, $_foreground = $version = json_decode(file_get_contents(__DIR__ . '/../../' . $package . '/package.json'), true)['version']; if ($type == 'npm') { if (file_exists(__DIR__ . '/../../' . $package . '/node_modules')) { - $found = 1; + exec('cd ' . __DIR__ . '/../../' . $package . ';' . self::getCmdSudo() . ' npm ls', $output, $return_var); + if ($return_var == 0) { + $found = 1; + } } } else { exec('cd ' . __DIR__ . '/../../' . $package . ';' . self::getCmdSudo() . ' yarn check', $output, $return_var); diff --git a/core/class/update.class.php b/core/class/update.class.php index aa30e085b6..a40b33593a 100644 --- a/core/class/update.class.php +++ b/core/class/update.class.php @@ -461,7 +461,7 @@ public function postInstallUpdate($_infos) { if (!file_exists($cibDir . '/' . $folder)) { continue; } - shell_exec('find ' . $cibDir . '/' . $folder . '/* -mtime +7 -type f ! -iname "custom.*" ! -iname "common.config.php" -delete 2>/dev/null'); + shell_exec('find ' . $cibDir . '/' . $folder . '/* -mtime +7 -type f ! -iname "custom.*" ! -iname "common.config.php" ! -path "./vendor/*" -delete 2>/dev/null'); } } catch (Exception $e) { $this->remove(); diff --git a/install/update.php b/install/update.php index d73db17105..cc36967821 100644 --- a/install/update.php +++ b/install/update.php @@ -221,7 +221,7 @@ echo "OK\n"; echo "[PROGRESS][52]\n"; echo "Remove useless files...\n"; - foreach (array('3rdparty', 'desktop', 'mobile', 'core', 'docs', 'install', 'script', 'vendor') as $folder) { + foreach (array('3rdparty', 'desktop', 'mobile', 'core', 'docs', 'install', 'script') as $folder) { echo 'Cleaning ' . $folder . "\n"; shell_exec('find ' . __DIR__ . '/../' . $folder . '/* -mtime +7 -type f ! -iname "custom.*" ! -iname "common.config.php" -delete'); }