From 723334e567b3789c3be7895154fc73de247626a8 Mon Sep 17 00:00:00 2001 From: Julien Jacottet Date: Mon, 11 Mar 2024 00:26:46 +0100 Subject: [PATCH] fix create create release directory --- src/Automate/Command/CheckCommand.php | 2 +- src/Automate/VariableResolver.php | 6 +++--- src/Automate/Workflow/Deployer.php | 2 +- src/Automate/Workflow/Session.php | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Automate/Command/CheckCommand.php b/src/Automate/Command/CheckCommand.php index a342919..6044135 100644 --- a/src/Automate/Command/CheckCommand.php +++ b/src/Automate/Command/CheckCommand.php @@ -50,7 +50,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $context->connect(); $logger->section('Check git access'); - $context->exec(function (Session $session) use ($project) { + $context->exec(static function (Session $session) use ($project): void { $session->exec('git ls-remote '.$project->getRepository(), false); }); } catch (\Exception $exception) { diff --git a/src/Automate/VariableResolver.php b/src/Automate/VariableResolver.php index 89f110a..7d3d2b4 100644 --- a/src/Automate/VariableResolver.php +++ b/src/Automate/VariableResolver.php @@ -17,11 +17,11 @@ class VariableResolver { - public const string ENV_PREFIX = 'AUTOMATE__'; + private const string ENV_PREFIX = 'AUTOMATE__'; - public const string VAR_PREFIX = '%'; + private const string VAR_PREFIX = '%'; - public const string VAR_SUFFIX = '%'; + private const string VAR_SUFFIX = '%'; /** * VariableResolver constructor. diff --git a/src/Automate/Workflow/Deployer.php b/src/Automate/Workflow/Deployer.php index e5845de..ec689ca 100644 --- a/src/Automate/Workflow/Deployer.php +++ b/src/Automate/Workflow/Deployer.php @@ -207,7 +207,7 @@ private function activateSymlink(): void private function createReleaseDirectory(): void { $this->context->exec(static function (Session $session): void { - $session->mkdir($session->getReleasePath()); + $session->mkdir($session->getReleasePath(), true); }); } } diff --git a/src/Automate/Workflow/Session.php b/src/Automate/Workflow/Session.php index 3986738..ec630dd 100644 --- a/src/Automate/Workflow/Session.php +++ b/src/Automate/Workflow/Session.php @@ -71,7 +71,7 @@ public function symlink(string $target, string $link): void public function touch(string $path): void { - $this->exec(sprintf('mkdir -p %s', dirname($path)), false); + $this->mkdir(dirname($path), true); $this->exec(sprintf('touch %s', $path), false); }