Skip to content

Commit 04ff00b

Browse files
committed
fix plugin add command when adding tgz
1 parent 5d4a438 commit 04ff00b

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)