Skip to content

fix jsonPath in ComposerScriptsConfigurator::update#1011

Merged
nicolas-grekas merged 4 commits intosymfony:2.xfrom
klkvsk:issue-1010
May 20, 2025
Merged

fix jsonPath in ComposerScriptsConfigurator::update#1011
nicolas-grekas merged 4 commits intosymfony:2.xfrom
klkvsk:issue-1010

Conversation

@klkvsk
Copy link
Copy Markdown
Contributor

@klkvsk klkvsk commented Feb 8, 2024

Fixes #1010

$jsonPath = ltrim(str_replace($recipeUpdate->getRootDir(), '', $json->getPath()), '/\\');

In case when root dir = ".", it replaces the dot in filename, and then applying the patch is broken with:

NOTE:
  The file composerjson was not updated because it doesn't exist in your app.

Change to using Path::makeRelative for proper result.

Comment thread src/Configurator/ComposerScriptsConfigurator.php Outdated
@nicolas-grekas nicolas-grekas merged commit 3c0362f into symfony:2.x May 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ComposerScriptsConfigurator can break "composer.json" filename in patch

3 participants