Skip to content

Commit

Permalink
[#1476] Added removal of the multiple empty lines in installer.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexSkrypnyk committed Jan 19, 2025
1 parent df49e80 commit 926a001
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions .vortex/installer/src/Command/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ protected function replaceTokens(): void {
'preserve_vortex_info',
'vortex_internal',
'enable_commented_code',
'empty_lines',
];

foreach ($processors as $name) {
Expand Down
8 changes: 7 additions & 1 deletion .vortex/installer/src/Traits/PromptsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -375,10 +375,16 @@ protected function processVortexInternal(string $dir): void {
}

protected function processEnableCommentedCode(string $dir): void {
// Enable_commented_code.
File::dirReplaceContent('##### ', '', $dir);
}

protected function processEmptyLines(string $dir): void {
$files = File::scandirRecursive($dir, File::ignorePaths());
foreach ($files as $filename) {
File::fileReplaceContent('/(\n\s*\n)+/', "\n\n", $filename);
}
}

protected function processWebroot(string $dir): void {
$new_name = $this->getAnswer('webroot', 'web');

Expand Down

1 comment on commit 926a001

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.