refactor: Change path of publish execution #930
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I experienced an issue using this plugin with semantic-release-monorepo.
When I define the pkfRoot, even though everything is set correctly, the npm cli do not attempt to publish the folder in pkgRoot prop, but the root of the package instead.
ExecaError: Command failed with exit code 1: npm publish /home/runner/work/bgc-packages/bgc-packages/packages/value-objects/dist --userconfig /tmp/bcb7296253aa364112caea30f087dbce/.npmrc --tag SUS2089 --registry 'https://registry.npmjs.org/'
As the error above shows, The path is correct at the dist folder, but the npm cli reads from the folder value-objects, instead of value-objects/dist.
So I read this plugin trying to understand why the prepare command works fine and the publish not, and I found that in prepare command we change de cwd while the publish command we assign the npm cli this responsibility.
This PR changes this. Both commands will now point the current working directory to the path that was given by the config file.