Skip to content

Commit

Permalink
[console] Fix generated files path message. (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmolivas committed Oct 28, 2017
1 parent 0f0c82e commit 115460e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
1 change: 1 addition & 0 deletions services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ services:
arguments: ['@console.translator_manager', '@console.string_converter']
console.file_queue:
class: Drupal\Console\Core\Utils\FileQueue
arguments: ['@app.root']
console.shell_process:
class: Drupal\Console\Core\Utils\ShellProcess
arguments: ['@app.root', '@console.translator_manager']
Expand Down
2 changes: 1 addition & 1 deletion src/EventSubscriber/ShowGeneratedFilesListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function showGeneratedFiles(ConsoleTerminateEvent $event)

$files = $this->fileQueue->getFiles();
if ($files) {
$this->showFile->generatedFiles($io, $files, false);
$this->showFile->generatedFiles($io, $files, true);
}
}

Expand Down
16 changes: 16 additions & 0 deletions src/Utils/FileQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,27 @@ class FileQueue
*/
private $files;

/**
* @var string
*/
protected $appRoot;

/**
* FileQueue constructor.
*
* @param string $appRoot
*/
public function __construct($appRoot)
{
$this->appRoot = $appRoot;
}

/**
* @param $file string
*/
public function addFile($file)
{
$file = str_replace($this->appRoot, '', $file);
$this->files[] = $file;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Utils/ShowFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function generatedFiles($io, $files, $showPath = true)
$pathKey = null;
$path = null;
if ($showPath) {
$pathKey = 'application.user.messages.path';
$pathKey = 'application.messages.path';
$path = $this->root;
}
$this->showMMultiple(
Expand Down

0 comments on commit 115460e

Please sign in to comment.