Skip to content

Commit

Permalink
fix: missed todo
Browse files Browse the repository at this point in the history
missed todo
  • Loading branch information
815are committed Sep 13, 2024
1 parent c2ab214 commit 211d838
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/fe-fpm-writer/src/building-block/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ export async function getSerializedFileContent<T extends BuildingBlock>(
const xmlDocument = config.viewOrFragmentPath
? getUI5XmlDocument(basePath, config.viewOrFragmentPath, fs)
: undefined;
const { content: manifest } = await getManifest(basePath, fs);
const { content: manifest } = await getManifest(basePath, fs, false);
const content = getTemplateContent(config.buildingBlockData, xmlDocument, manifest, fs, true);
const filePathProps = getFilePathProps(basePath, config.viewOrFragmentPath);
return {
Expand Down
10 changes: 5 additions & 5 deletions packages/fe-fpm-writer/src/common/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@ export async function getManifestPath(basePath: string, fs: Editor): Promise<str
*
* @param {string} basePath the base path
* @param {Editor} fs the memfs editor instance
* @param {boolean} [validate=true] validate if 'manifest.json' file exists - throw error if file does not exist
* @returns {Manifest | undefined} The content and path of the manifest
*/
export async function getManifest(basePath: string, fs: Editor): Promise<ManifestData> {
export async function getManifest(basePath: string, fs: Editor, validate = true): Promise<ManifestData> {
const path = await getManifestPath(basePath, fs);
// ToDo???
// if (!fs.exists(manifestPath)) {
// throw new Error(`Invalid project folder. Cannot find required file ${manifestPath}`);
// }
if (validate && !fs.exists(path)) {
throw new Error(`Invalid project folder. Cannot find required file ${path}`);
}
return {
path,
content: fs.readJSON(path) as Manifest
Expand Down

0 comments on commit 211d838

Please sign in to comment.