Fixed service required twice error

Signed-off-by: boris <boris.karastanev@progress.com>
This commit is contained in:
boris 2017-09-27 13:45:15 +03:00
Родитель 16bcbdde15
Коммит 769b4074b8
4 изменённых файлов: 7 добавлений и 7 удалений

Просмотреть файл

@ -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"));

Просмотреть файл

@ -162,4 +162,4 @@ export class GitService implements IGitService {
}
}
$injector.register("gitService", GitService);
$injector.register("gitApiService", GitService);

Просмотреть файл

@ -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);

Просмотреть файл

@ -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;