Skip to content

Commit

Permalink
Merge pull request #2265 from jeedom/alpha
Browse files Browse the repository at this point in the history
merge
  • Loading branch information
Loïc committed Jul 26, 2023
2 parents 68e0555 + 1e22479 commit 6b12140
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion core/class/jeedom.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 . '" ';
}
Expand Down
5 changes: 4 additions & 1 deletion core/class/system.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion core/class/update.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion install/update.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down

0 comments on commit 6b12140

Please sign in to comment.