diff --git a/bin/console.php b/bin/console.php index b4f4dcb..6799100 100755 --- a/bin/console.php +++ b/bin/console.php @@ -6,9 +6,6 @@ setlocale(LC_ALL, 'en_US.UTF8'); error_reporting(E_ALL); -// ensure correct absolute path -chdir(dirname($argv[0])); - require_once dirname(__DIR__) . '/vendor/autoload.php'; use Composer\InstalledVersions; @@ -27,8 +24,6 @@ ) ); -define('__ROOT__', dirname(__DIR__)); - // default PHP_ENV to "prod" if (isset($_ENV['PHP_ENV']) === false) { $_ENV['PHP_ENV'] = 'prod'; diff --git a/src/Commands/Manifest/UploadCommand.php b/src/Commands/Manifest/UploadCommand.php index af386c4..aef8de5 100644 --- a/src/Commands/Manifest/UploadCommand.php +++ b/src/Commands/Manifest/UploadCommand.php @@ -47,7 +47,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $json = (bool)$input->getOption('json'); $idOnly = (bool)$input->getOption('id-only'); $manifest = $input->getArgument('manifest'); - $manifest = Path::makeAbsolute($manifest, __ROOT__); + $manifest = Path::makeAbsolute($manifest, getcwd()); if (is_file($manifest) === false) { $output->writeln("File \"{$manifest}\" could not be found"); diff --git a/src/Commands/Manifest/ValidateCommand.php b/src/Commands/Manifest/ValidateCommand.php index dc3bd7d..20b4e3d 100644 --- a/src/Commands/Manifest/ValidateCommand.php +++ b/src/Commands/Manifest/ValidateCommand.php @@ -70,7 +70,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $filePath = $input->getOption('file'); $fileRules = []; if ($filePath !== null) { - $filePath = Path::makeAbsolute($filePath, __ROOT__); + $filePath = Path::makeAbsolute($filePath, getcwd()); if (is_file($filePath) === false) { $output->writeln( sprintf(