5353use function array_pop ;
5454use function assert ;
5555use function count ;
56- use function getcwd ;
5756use function implode ;
5857use function is_countable ;
5958use function is_dir ;
6059use function microtime ;
6160use function pathinfo ;
62- use function realpath ;
6361use function sprintf ;
64- use function str_starts_with ;
6562use function strtoupper ;
6663
6764final class Run extends Command
@@ -261,7 +258,7 @@ private function getSettingsOverriddenWithInput(InputInterface $input): ProjectS
261258 protected function execute (InputInterface $ input , OutputInterface $ output ): int
262259 {
263260 $ settings = $ this ->getSettingsOverriddenWithInput ($ input );
264- $ inputDir = $ this -> getAbsolutePath ( $ settings ->getInput () );
261+ $ inputDir = $ settings ->getInput ();
265262 if (!is_dir ($ inputDir )) {
266263 throw new RuntimeException (sprintf ('Input directory "%s" was not found! ' . "\n" .
267264 'Run "vendor/bin/guides -h" for information on how to configure this command. ' , $ inputDir ));
@@ -281,7 +278,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
281278 $ projectNode = $ event ->getProjectNode ();
282279 $ settings = $ event ->getSettings ();
283280
284- $ outputDir = $ this -> getAbsolutePath ( $ settings ->getOutput () );
281+ $ outputDir = $ settings ->getOutput ();
285282 $ sourceFileSystem = new Filesystem (new Local ($ settings ->getInput ()));
286283 $ sourceFileSystem ->addPlugin (new Finder ());
287284 $ logPath = $ settings ->getLogPath ();
@@ -367,21 +364,4 @@ protected function execute(InputInterface $input, OutputInterface $output): int
367364
368365 return Command::SUCCESS ;
369366 }
370-
371- private function getAbsolutePath (string $ path ): string
372- {
373- $ absolutePath = $ path ;
374- if (!str_starts_with ($ absolutePath , '/ ' )) {
375- if (getcwd () === false ) {
376- throw new RuntimeException ('Cannot find current working directory, use absolute paths. ' );
377- }
378-
379- $ absolutePath = realpath (getcwd () . '/ ' . $ absolutePath );
380- if ($ absolutePath === false ) {
381- throw new RuntimeException ('Cannot find path " ' . $ path . '". ' );
382- }
383- }
384-
385- return $ absolutePath ;
386- }
387367}
0 commit comments