Skip to content

Commit

Permalink
DP-931 cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGandacov committed Aug 2, 2023
1 parent 593aefc commit d3a1da4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/services/file-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ export class FileService {
}

public readManifestFile(importedFileName: string): Promise<ManifestNodeTransport[]> {
const manifest: ManifestNodeTransport[] = YAML.parse(fs.readFileSync(path.resolve(importedFileName + "/manifest.yml"), { encoding: "utf-8" }));
const manifest: ManifestNodeTransport[] = YAML.parse(
fs.readFileSync(path.resolve(importedFileName + "/manifest.yml"), { encoding: "utf-8" })
);
return Promise.all(manifest);
}

public readFile(filename: string): string {
if (!fs.existsSync(path.resolve(process.cwd(), filename))) {
logger.error(new FatalError("The provided file does not exit"));
logger.error(new FatalError(`The provided file '${filename}' does not exit`));
}
return fs.readFileSync(path.resolve(process.cwd(), filename), { encoding: "utf-8" });
}
Expand Down

0 comments on commit d3a1da4

Please sign in to comment.