Skip to content

Conversation

@rosen-vladimirov
Copy link
Contributor

When invalid plugin data is written in project's package.json, tns plugin remove <name> command fails.
In such cases npm uninstall --save <name> just removes the entry from package.json, so we should do the same.
By invalid data I mean invalid version (not existing version or path to non-existing file).

Plugin remove command's canExecute method is trying to install all plugins in order to get information about their native code, so it will be removed from platforms dir.
The installation fails when some plugin's data is invalid.
Catch the error and check package.json's dependencies instead.
Also make sure plugin variables data is removed from package.json when plugin is removed.
Currently it's been removed only when platform is added and plugin has native code.

Fixes #1541

@rosen-vladimirov rosen-vladimirov self-assigned this Mar 9, 2016
@rosen-vladimirov rosen-vladimirov added this to the 1.7.0 milestone Mar 9, 2016
@vchimev
Copy link

vchimev commented Mar 10, 2016

run ci

When invalid plugin data is written in project's package.json, `tns plugin remove <name>` command fails.
In such cases `npm uninstall --save <name>` just removes the entry from package.json, so we should do the same.
By invalid data I mean invalid version (not existing version or path to non-existing file).

Plugin remove command's canExecute method is trying to install all plugins in order to get information about their native code, so it will be removed from `platforms` dir.
The installation fails when some plugin's data is invalid.
Catch the error and check package.json's dependencies instead.
Also make sure plugin variables data is removed from package.json when plugin is removed.
Currently it's been removed only when platform is added and plugin has native code.
@rosen-vladimirov rosen-vladimirov force-pushed the vladimirov/fix-pl-remove branch from 407c10d to 82c972d Compare March 10, 2016 09:30
@teobugslayer
Copy link
Contributor

👍

rosen-vladimirov added a commit that referenced this pull request Mar 10, 2016
Fix plugin remove command for invalid plugins
@rosen-vladimirov rosen-vladimirov merged commit cf67724 into release Mar 10, 2016
@rosen-vladimirov rosen-vladimirov deleted the vladimirov/fix-pl-remove branch March 10, 2016 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants