Przeglądaj źródła

git clean before git auto-update (#2036)

* git clean before git auto-update

To avoid https://github.com/FreshRSS/FreshRSS/issues/2012 in the future

* More generic SQLite file filter

* Another -f

https://git-scm.com/docs/git-clean
Alexandre Alapetite 7 lat temu
rodzic
commit
83756c657f
2 zmienionych plików z 8 dodań i 2 usunięć
  1. 7 1
      app/Controllers/updateController.php
  2. 1 1
      data/users/.gitignore

+ 7 - 1
app/Controllers/updateController.php

@@ -32,7 +32,13 @@ class FreshRSS_update_Controller extends Minz_ActionController {
 		$output = array();
 		$return = 1;
 		try {
-			exec('git pull --ff-only', $output, $return);
+			exec('git clean -f -d -f', $output, $return);
+			if ($return == 0) {
+				exec('git pull --ff-only', $output, $return);
+			} else {
+				$line = is_array($output) ? implode('; ', $output) : '' . $output;
+				Minz_Log::warning('git clean warning:' . $line);
+			}
 		} catch (Exception $e) {
 			Minz_Log::warning('git pull error:' . $e->getMessage());
 		}

+ 1 - 1
data/users/.gitignore

@@ -1,5 +1,5 @@
 */
 */config.php
-*/db.sqlite
+*/*.sqlite
 !_/
 */log*.txt