Push update.
Some checks failed
ci/woodpecker/push/docker Pipeline was successful
ci/woodpecker/push/test Pipeline failed

This commit is contained in:
2025-04-01 14:09:39 +00:00
parent 580653bbea
commit 3f33729b4b
4 changed files with 11 additions and 3 deletions

View File

@ -43,7 +43,7 @@
"@analyze-psalm",
"@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-phpstan":"phpstan",
"analyze-psalm": "psalm --no-cache",

View File

@ -35,6 +35,7 @@ final class App
$this->config = new Configuration([
'rclone' => Expect::structure([
'path' => Expect::string()->default('rclone'),
'config' => Expect::string()->default(''),
'options' => Expect::arrayOf('string', 'string')
]),
'backup' => Expect::arrayOf(Expect::structure([

View File

@ -64,7 +64,7 @@ final class CommandBackup extends Command
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();
/**

View File

@ -28,8 +28,9 @@ final class Rclone
* But the path can be configured to be absolute.
*
* @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;
@ -112,9 +113,15 @@ final class Rclone
*/
private function exec(string $command, array $options = []): Process
{
$rcloneconfig = [];
if ($this->rcloneConfig != '') {
$rcloneconfig = ['--config', $this->rcloneConfig];
}
$process = new Process(
array_merge(
[$this->rclonePath],
$rcloneconfig,
[$command],
$options
)