From 769b4074b834c98d4e532cf5a920e72bda0ab13a Mon Sep 17 00:00:00 2001 From: boris Date: Wed, 27 Sep 2017 13:45:15 +0300 Subject: [PATCH] Fixed service required twice error Signed-off-by: boris --- lib/bootstrap.ts | 2 +- lib/services/git-service.ts | 2 +- lib/services/page-service.ts | 4 ++-- lib/services/template-service.ts | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/bootstrap.ts b/lib/bootstrap.ts index 83febee..5186b3f 100644 --- a/lib/bootstrap.ts +++ b/lib/bootstrap.ts @@ -1,6 +1,6 @@ import * as path from "path"; -$injector.require("gitService", path.join(__dirname, "services", "git-service")); +$injector.require("gitApiService", path.join(__dirname, "services", "git-service")); $injector.require("pageService", path.join(__dirname, "services", "page-service")); $injector.requirePublicClass("templateService", path.join(__dirname, "services", "template-service")); $injector.requirePublicClass("applicationService", path.join(__dirname, "services", "application-service")); diff --git a/lib/services/git-service.ts b/lib/services/git-service.ts index 5509f24..48321d1 100644 --- a/lib/services/git-service.ts +++ b/lib/services/git-service.ts @@ -162,4 +162,4 @@ export class GitService implements IGitService { } } -$injector.register("gitService", GitService); +$injector.register("gitApiService", GitService); diff --git a/lib/services/page-service.ts b/lib/services/page-service.ts index 1e7dbca..0433b31 100644 --- a/lib/services/page-service.ts +++ b/lib/services/page-service.ts @@ -8,7 +8,7 @@ const ejs = require("ejs"); export class PageService implements IPageService { - constructor(private $gitService: IGitService) { + constructor(private $gitApiService: IGitService) { } getPages() { @@ -32,7 +32,7 @@ export class PageService implements IPageService { return Promise.reject(new Error(`Page with the name "${pageName}" already exists`)); } - return this.$gitService.clonePageTemplate(displayName, pageTemplate.templateFlavor, pagesDirectory); + return this.$gitApiService.clonePageTemplate(displayName, pageTemplate.templateFlavor, pagesDirectory); }) .then((downloadPath: any) => { return this.createPage(downloadPath, newPageDirectory, pageName); diff --git a/lib/services/template-service.ts b/lib/services/template-service.ts index e728453..a99494e 100644 --- a/lib/services/template-service.ts +++ b/lib/services/template-service.ts @@ -7,7 +7,7 @@ const nodeCache = require("node-cache"); export class TemplateService implements ITemplateService { templateCache: any; - constructor(private $gitService: IGitService) { + constructor(private $gitApiService: IGitService) { this.templateCache = new nodeCache(); } @@ -48,7 +48,7 @@ export class TemplateService implements ITemplateService { const templateDetails: any = {}; return new Promise((resolve, reject) => { - this.$gitService.getPackageJsonFromSource(templateName) + this.$gitApiService.getPackageJsonFromSource(templateName) .then((packageJsonData: any) => { const packageJson = packageJsonData; this.getTemplateMetaData(packageJson) @@ -66,7 +66,7 @@ export class TemplateService implements ITemplateService { const templateTag = "v" + templateDetails.version; templateDetails.templateFlavor = flavor; - return this.$gitService.getAssetsContent(templateName, templateTag); + return this.$gitApiService.getAssetsContent(templateName, templateTag); }) .then((resources) => { templateDetails.resources = resources;