From 92a4bea5e2f186a31c01835fc9fc655382204f22 Mon Sep 17 00:00:00 2001 From: Ayoub Date: Mon, 8 May 2017 11:38:28 +0200 Subject: [PATCH] feat(@angular/cli): add custom addon possiblity for custom commands (#2906) --- .../angular-cli/ember-cli/lib/models/project.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/angular-cli/ember-cli/lib/models/project.js b/packages/angular-cli/ember-cli/lib/models/project.js index fa0fcc206fcf..3cf55575207d 100644 --- a/packages/angular-cli/ember-cli/lib/models/project.js +++ b/packages/angular-cli/ember-cli/lib/models/project.js @@ -298,8 +298,20 @@ Project.prototype.initializeAddons = function() { pkg: cliPkg, }); + let customAddonObject = { + name: 'custom-addon', + path: this.root, + pkg: cliPkg, + } + let customAddonModulePath = Addon.resolvePath(customAddonObject); + if(existsSync(customAddonModulePath)){ + const CustomAddonLookup = Addon.lookup(customAddonObject); + const customAddon = new CustomAddonLookup(this.addonParent, this); + this.addons.push(customAddon); + } + const addon = new Constructor(this.addonParent, this); - this.addons = [addon]; + this.addons.push(addon); }; /**