Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
0.5.0: Appsody - Ignore paths and use settings file (#761)
Browse files Browse the repository at this point in the history
* ignore paths

Signed-off-by: Andrew Mak <[email protected]>

* don't rely on output

Signed-off-by: Andrew Mak <[email protected]>
  • Loading branch information
makandre authored and sghung committed Oct 22, 2019
1 parent 976bee5 commit 3f23a01
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/pfe/file-watcher/server/src/projects/ShellExtensionProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -59,6 +59,7 @@ interface ShellExtensionProjectConfig {
export class ShellExtensionProject implements IExtensionProject {

supportedType: string;
defaultIgnoredPath: string[] = ["*/*"];

private fullPath: string;
private config: ShellExtensionProjectConfig;
Expand All @@ -82,11 +83,21 @@ export class ShellExtensionProject implements IExtensionProject {
*/
private setLanguage = async (projectInfo: ProjectInfo): Promise<void> => {

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 {
Expand All @@ -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;
}
Expand Down

0 comments on commit 3f23a01

Please sign in to comment.