53
53
use function array_pop ;
54
54
use function assert ;
55
55
use function count ;
56
- use function getcwd ;
57
56
use function implode ;
58
57
use function is_countable ;
59
58
use function is_dir ;
60
59
use function microtime ;
61
60
use function pathinfo ;
62
- use function realpath ;
63
61
use function sprintf ;
64
- use function str_starts_with ;
65
62
use function strtoupper ;
66
63
67
64
final class Run extends Command
@@ -261,7 +258,7 @@ private function getSettingsOverriddenWithInput(InputInterface $input): ProjectS
261
258
protected function execute (InputInterface $ input , OutputInterface $ output ): int
262
259
{
263
260
$ settings = $ this ->getSettingsOverriddenWithInput ($ input );
264
- $ inputDir = $ this -> getAbsolutePath ( $ settings ->getInput () );
261
+ $ inputDir = $ settings ->getInput ();
265
262
if (!is_dir ($ inputDir )) {
266
263
throw new RuntimeException (sprintf ('Input directory "%s" was not found! ' . "\n" .
267
264
'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
281
278
$ projectNode = $ event ->getProjectNode ();
282
279
$ settings = $ event ->getSettings ();
283
280
284
- $ outputDir = $ this -> getAbsolutePath ( $ settings ->getOutput () );
281
+ $ outputDir = $ settings ->getOutput ();
285
282
$ sourceFileSystem = new Filesystem (new Local ($ settings ->getInput ()));
286
283
$ sourceFileSystem ->addPlugin (new Finder ());
287
284
$ logPath = $ settings ->getLogPath ();
@@ -367,21 +364,4 @@ protected function execute(InputInterface $input, OutputInterface $output): int
367
364
368
365
return Command::SUCCESS ;
369
366
}
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
- }
387
367
}
0 commit comments