snapcraft icon indicating copy to clipboard operation
snapcraft copied to clipboard

NodeJS V1 Plugin: check source-subdir for package.json if specified

Open debdutdeb opened this issue 3 years ago • 2 comments

  • [x] Have you followed the guidelines for contributing?
  • [x] Have you signed the CLA?
  • [x] Have you successfully run ./runtests.sh static?
  • [x] Have you successfully run ./runtests.sh tests/unit?

Issue

_install_node_and_yarn doesn't check for the source-subdir value as expected or specified in the NodejsPluginMissingPackageJsonError error message -

https://github.com/snapcore/snapcraft/blob/2a2342c69334a6b2a00dbbda21b09ea81111773f/snapcraft/plugins/v1/nodejs.py#L150 https://github.com/snapcore/snapcraft/blob/2a2342c69334a6b2a00dbbda21b09ea81111773f/snapcraft/plugins/v1/nodejs.py#L80

Fix

Now it checks if source-subdir is specified or not, and checks for package.json accordingly.

Fixes https://bugs.launchpad.net/snapcraft/+bug/1694642

debdutdeb avatar Aug 27 '21 12:08 debdutdeb

Thanks for your contribution. If you don't mind a unit test would be appreciated.

sergiusens avatar Aug 30 '21 18:08 sergiusens

Hi. Thanks for taking a look at it. Modified the tests according to the base plugin change.

debdutdeb avatar Sep 05 '21 15:09 debdutdeb