Push update.
This commit is contained in:
		| @@ -43,7 +43,7 @@ | |||||||
|             "@analyze-psalm", |             "@analyze-psalm", | ||||||
|             "@analyze-phpcs" |             "@analyze-phpcs" | ||||||
|         ], |         ], | ||||||
|         "analyze-yaml":   "vendor/bin/yaml-lint *.yml *.yaml *.json", |         "analyze-yaml":   "vendor/bin/yaml-lint .", | ||||||
|         "analyze-phpmd":  "phpmd src,tests text  cleancode,codesize,controversial,design,naming,unusedcode", |         "analyze-phpmd":  "phpmd src,tests text  cleancode,codesize,controversial,design,naming,unusedcode", | ||||||
|         "analyze-phpstan":"phpstan", |         "analyze-phpstan":"phpstan", | ||||||
|         "analyze-psalm":  "psalm --no-cache", |         "analyze-psalm":  "psalm --no-cache", | ||||||
|   | |||||||
| @@ -35,6 +35,7 @@ final class App | |||||||
|         $this->config = new Configuration([ |         $this->config = new Configuration([ | ||||||
|             'rclone' => Expect::structure([ |             'rclone' => Expect::structure([ | ||||||
|                 'path' => Expect::string()->default('rclone'), |                 'path' => Expect::string()->default('rclone'), | ||||||
|  |                 'config' => Expect::string()->default(''), | ||||||
|                 'options' => Expect::arrayOf('string', 'string') |                 'options' => Expect::arrayOf('string', 'string') | ||||||
|             ]), |             ]), | ||||||
|             'backup' => Expect::arrayOf(Expect::structure([ |             'backup' => Expect::arrayOf(Expect::structure([ | ||||||
|   | |||||||
| @@ -64,7 +64,7 @@ final class CommandBackup extends Command | |||||||
|             return Command::FAILURE; |             return Command::FAILURE; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         $rclone = new Rclone($app->getLogger()->withName('rclone'), (string)$app->getConfig('rclone.path')); |         $rclone = new Rclone($app->getLogger()->withName('rclone'), (string)$app->getConfig('rclone.path'), (string)$app->getConfig('rclone.config')); | ||||||
|  |  | ||||||
|         $notification = new Notification(); |         $notification = new Notification(); | ||||||
|         /** |         /** | ||||||
|   | |||||||
| @@ -28,8 +28,9 @@ final class Rclone | |||||||
|      * But the path can be configured to be absolute. |      * But the path can be configured to be absolute. | ||||||
|      * |      * | ||||||
|      * @param string $rclonePath Relative or absolute path |      * @param string $rclonePath Relative or absolute path | ||||||
|  |      * @param string $rcloneConfig Relative or absolute path to the rclone config file | ||||||
|      */ |      */ | ||||||
|     public function __construct(protected LoggerInterface $logger, protected string $rclonePath = "rclone") |     public function __construct(protected LoggerInterface $logger, protected string $rclonePath = "rclone", protected string $rcloneConfig = '') | ||||||
|     { |     { | ||||||
|         $this->rclonePath = $rclonePath; |         $this->rclonePath = $rclonePath; | ||||||
|  |  | ||||||
| @@ -112,9 +113,15 @@ final class Rclone | |||||||
|      */ |      */ | ||||||
|     private function exec(string $command, array $options = []): Process |     private function exec(string $command, array $options = []): Process | ||||||
|     { |     { | ||||||
|  |         $rcloneconfig = []; | ||||||
|  |         if ($this->rcloneConfig != '') { | ||||||
|  |             $rcloneconfig = ['--config', $this->rcloneConfig]; | ||||||
|  |         } | ||||||
|  |  | ||||||
|         $process = new Process( |         $process = new Process( | ||||||
|             array_merge( |             array_merge( | ||||||
|                 [$this->rclonePath], |                 [$this->rclonePath], | ||||||
|  |                 $rcloneconfig, | ||||||
|                 [$command], |                 [$command], | ||||||
|                 $options |                 $options | ||||||
|             ) |             ) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user