Skip to content

Commit

Permalink
Fix path resolution in manifest:update and manifest:validate
Browse files Browse the repository at this point in the history
  • Loading branch information
flavioheleno committed Jul 3, 2023
1 parent eda0abe commit 3a55bfa
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
5 changes: 0 additions & 5 deletions bin/console.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -27,8 +24,6 @@
)
);

define('__ROOT__', dirname(__DIR__));

// default PHP_ENV to "prod"
if (isset($_ENV['PHP_ENV']) === false) {
$_ENV['PHP_ENV'] = 'prod';
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Manifest/UploadCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Manifest/ValidateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 3a55bfa

Please sign in to comment.