Skip to content

Commit

Permalink
fix(util): compose unique name for tree children
Browse files Browse the repository at this point in the history
  • Loading branch information
manushak committed Aug 8, 2024
1 parent 862ca01 commit dd24689
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/if-merge/util/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import * as path from 'path';

import {getFileName, getYamlFiles} from '../../common/util/fs';
import {Context} from '../../common/types/manifest';
import {load} from '../../common/lib/load';
Expand Down Expand Up @@ -35,6 +37,8 @@ const mergeManifestsData = async (manifests: string[], context: Context) => {
for await (const manifest of manifests) {
const manifestName = getFileName(manifest);
const {rawManifest} = await load(manifest);
const parentDir = path.basename(path.dirname(manifest));
const uniqueName = `${parentDir}-${manifestName}`;

context.tags = Object.assign({}, context.tags, rawManifest.tags);
context.initialize.plugins = {
Expand All @@ -43,7 +47,7 @@ const mergeManifestsData = async (manifests: string[], context: Context) => {
};

Object.keys(rawManifest.tree.children).forEach(child => {
tree.children[`${child}-${manifestName}`] = {
tree.children[`${child}-${uniqueName}`] = {
...rawManifest.tree.children[child],
};
});
Expand Down

0 comments on commit dd24689

Please sign in to comment.