From 3f23a0133248857ac8bddacc0341f19d22ef2012 Mon Sep 17 00:00:00 2001 From: Andrew Mak Date: Tue, 22 Oct 2019 09:47:59 -0400 Subject: [PATCH] 0.5.0: Appsody - Ignore paths and use settings file (#761) * ignore paths Signed-off-by: Andrew Mak * don't rely on output Signed-off-by: Andrew Mak --- .../src/projects/ShellExtensionProject.ts | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/pfe/file-watcher/server/src/projects/ShellExtensionProject.ts b/src/pfe/file-watcher/server/src/projects/ShellExtensionProject.ts index 0f85b4a23..0c888f24d 100644 --- a/src/pfe/file-watcher/server/src/projects/ShellExtensionProject.ts +++ b/src/pfe/file-watcher/server/src/projects/ShellExtensionProject.ts @@ -22,7 +22,7 @@ import * as projectEventsController from "../controllers/projectEventsController import { IExtensionProject } from "../extensions/IExtensionProject"; import * as processManager from "../utils/processManager"; import * as logger from "../utils/logger"; -import { StartModes } from "./constants"; +import { projectConstants, StartModes } from "./constants"; /** * @interface @@ -59,6 +59,7 @@ interface ShellExtensionProjectConfig { export class ShellExtensionProject implements IExtensionProject { supportedType: string; + defaultIgnoredPath: string[] = ["*/*"]; private fullPath: string; private config: ShellExtensionProjectConfig; @@ -82,11 +83,21 @@ export class ShellExtensionProject implements IExtensionProject { */ private setLanguage = async (projectInfo: ProjectInfo): Promise => { + const logDir = await logHelper.getLogDir( + projectInfo.projectID, path.basename(projectInfo.location)); + const args = [ projectInfo.location, projectUtil.LOCAL_WORKSPACE, projectInfo.projectID, - projectInfo.language + projectInfo.language, + "", + "", + "", + "", + "", + "", + logDir ]; try { @@ -97,8 +108,8 @@ export class ShellExtensionProject implements IExtensionProject { {}); if (!result.stderr) { - const lastLine = result.stdout.substring(result.stdout.lastIndexOf("\n") + 1); - const json = JSON.parse(lastLine); + const json = await fs.readJson( + path.join(projectConstants.projectsLogDir, logDir, "settings.json"), { encoding: "utf8" }); this.language = json.language; return; }