Skip to content

Commit 032add5

Browse files
committed
refactor: reuse pluginsService.isNativeScript plugin from node-modules-dest-copy
1 parent a6673eb commit 032add5

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/tools/node-modules/node-modules-dest-copy.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ export class TnsModulesCopy {
1111
constructor(
1212
private outputRoot: string,
1313
private $options: IOptions,
14-
private $fs: IFileSystem
14+
private $fs: IFileSystem,
15+
private $pluginsService: IPluginsService
1516
) {
1617
}
1718

@@ -67,9 +68,7 @@ export class TnsModulesCopy {
6768
const pathToDependency = path.join(dependenciesFolder, d);
6869
const pathToPackageJson = path.join(pathToDependency, constants.PACKAGE_JSON_FILE_NAME);
6970

70-
// TODO: Reuse pluginsService.isNativeScriptPlugin after making it work with full path.
71-
const pluginPackageJsonContent = this.$fs.readJson(pathToPackageJson);
72-
if (pluginPackageJsonContent && pluginPackageJsonContent.nativescript) {
71+
if (this.$pluginsService.isNativeScriptPlugin(pathToPackageJson)) {
7372
this.$fs.deleteDirectory(path.join(pathToDependency, constants.PLATFORMS_DIR_NAME));
7473
}
7574

0 commit comments

Comments
 (0)