Skip to content

Commit d486431

Browse files
authored
Merge pull request #2271 from NativeScript/plamen5kov/plugin_add_tgz_fix
fix plugin add command when adding tgz
2 parents f1bd267 + 04ff00b commit d486431

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/services/plugins-service.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,11 @@ export class PluginsService implements IPluginsService {
3636
public add(plugin: string): IFuture<void> {
3737
return (() => {
3838
this.ensure().wait();
39+
const possiblePackageName= path.resolve(plugin);
40+
if(possiblePackageName.indexOf(".tgz") !== -1 && this.$fs.exists(possiblePackageName).wait()) {
41+
plugin = possiblePackageName;
42+
}
3943
let name = this.$npm.install(plugin, this.$projectData.projectDir, PluginsService.NPM_CONFIG).wait()[0];
40-
4144
let pathToRealNpmPackageJson = path.join(this.$projectData.projectDir, "node_modules", name, "package.json");
4245
let realNpmPackageJson = this.$fs.readJson(pathToRealNpmPackageJson).wait();
4346

0 commit comments

Comments
 (0)