snapcraft
snapcraft copied to clipboard
NodeJS V1 Plugin: check source-subdir for package.json if specified
- [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
Thanks for your contribution. If you don't mind a unit test would be appreciated.
Hi. Thanks for taking a look at it. Modified the tests according to the base plugin change.