Skip to content

Commit

Permalink
Add clean cache option for collecting
Browse files Browse the repository at this point in the history
  • Loading branch information
richardDobron committed Apr 19, 2023
1 parent 973d6c3 commit d641a60
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion bin/fbt
Expand Up @@ -22,7 +22,8 @@ $app->registerCommand('collect-fbts', function (Minicli\Command\CommandCall $app
$generateTranslationsService->collectFromFiles(
$app->getParam('--path'),
$app->getParam('--src'),
$app->getParam('--fbt-common-path')
$app->getParam('--fbt-common-path'),
true
);
});

Expand Down
4 changes: 2 additions & 2 deletions src/fbt/Services/CollectFbtsService.php
Expand Up @@ -53,7 +53,7 @@ public function __construct()
* @throws \fbt\Exceptions\FbtInvalidConfigurationException
* @throws \fbt\Exceptions\FbtParserException
*/
public function collectFromFiles(string $path, string $src, string $fbtCommonPath)
public function collectFromFiles(string $path, string $src, string $fbtCommonPath, bool $cleanCache)
{
$fbtDir = $path . '/';
$file = $fbtDir . '.source_strings.json';
Expand All @@ -62,7 +62,7 @@ public function collectFromFiles(string $path, string $src, string $fbtCommonPat
mkdir($fbtDir, 0755, true);
}

if (file_exists($file)) {
if ($cleanCache && file_exists($file)) {
unlink($file);
}

Expand Down

0 comments on commit d641a60

Please sign in to comment.