Skip to content

Commit 0ccf3cc

Browse files
Bohdan Korablovoshmyheliuk
authored andcommitted
MAGECLOUD-1575: Error during vendor/bin/m2-ece-scd-dump command (#141)
1 parent a7aa6bd commit 0ccf3cc

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/App/Logger.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ private function prepare()
6666

6767
$this->file->createDirectory($this->directoryList->getLog());
6868

69-
if ($deployLogFileExists && !$this->isBuildLogApplied($deployLogPath, $buildPhaseLogContent)) {
69+
if ($deployLogFileExists
70+
&& $buildPhaseLogContent
71+
&& !$this->isBuildLogApplied($deployLogPath, $buildPhaseLogContent)
72+
) {
7073
$this->file->filePutContents($deployLogPath, $buildPhaseLogContent, FILE_APPEND);
7174
} elseif (!$deployLogFileExists && $buildLogFileExists) {
7275
$this->file->copy($buildPhaseLogPath, $deployLogPath);

src/Test/Unit/App/LoggerTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,15 @@ public function executeDataProvider(): array
139139
'deployLogFileExists' => true,
140140
'fileMockFilePutContentsExpects' => 1,
141141
'fileMockCopyExpects' => 0,
142+
],
143+
[
144+
'fileMockFileGetContentsExpects' => 0,
145+
'buildPhaseLogContent' => '',
146+
'buildLogFileExists' => false,
147+
'deployLogContent' => 'some log the build phase log was applied some log',
148+
'deployLogFileExists' => true,
149+
'fileMockFilePutContentsExpects' => 0,
150+
'fileMockCopyExpects' => 0,
142151
]
143152
];
144153
}

0 commit comments

Comments
 (0)