@@ -22,13 +22,6 @@ class Dumper extends Helper {
2222 */
2323 public $ filesystem ;
2424
25- /**
26- * The base directory.
27- *
28- * @var string
29- */
30- protected $ baseDirectory ;
31-
3225 /**
3326 * Input instance.
3427 *
@@ -97,11 +90,7 @@ public function dump(InputInterface $input, OutputInterface $output) {
9790 /** @var \DrupalCodeGenerator\Command\GeneratorInterface $command */
9891 $ command = $ this ->getHelperSet ()->getCommand ();
9992
100- $ directory = $ command ->getDirectory ();
101- $ extension_root = Utils::getExtensionRoot ($ directory );
102- $ this ->baseDirectory = ($ extension_root ?: $ directory ) . '/ ' ;
103-
104- $ dumped_files = $ this ->doDump ($ command ->getFiles ());
93+ $ dumped_files = $ this ->doDump ($ command ->getFiles (), $ command ->getDirectory ());
10594
10695 $ input ->setInteractive ($ interactive );
10796 return $ dumped_files ;
@@ -112,11 +101,13 @@ public function dump(InputInterface $input, OutputInterface $output) {
112101 *
113102 * @param array $files
114103 * Files to dump.
104+ * @param string $directory
105+ * Directory where to dump the files.
115106 *
116107 * @return array
117108 * List of created or updated files.
118109 */
119- protected function doDump (array $ files ) {
110+ protected function doDump (array $ files, $ directory ) {
120111 $ dumped_files = [];
121112
122113 foreach ($ files as $ file_name => $ file_info ) {
@@ -126,7 +117,7 @@ protected function doDump(array $files) {
126117
127118 $ is_directory = $ content === NULL ;
128119
129- $ file_path = $ this -> baseDirectory . $ file_name ;
120+ $ file_path = $ directory . ' / ' . $ file_name ;
130121 if ($ this ->filesystem ->exists ($ file_path ) && !$ is_directory ) {
131122 $ action = isset ($ file_info ['action ' ]) ? $ file_info ['action ' ] : 'replace ' ;
132123 if ($ action == 'replace ' ) {
0 commit comments