Skip to content

Commit

Permalink
user config osLoc fix and unit test
Browse files Browse the repository at this point in the history
Signed-off-by: jace-roell <[email protected]>
  • Loading branch information
jace-roell committed Dec 17, 2024
1 parent 4386b17 commit 5b85f22
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,14 @@ describe("TeamConfig ProfileInfo tests", () => {
expect(arg.argValue).toEqual(expectedArgs[idx].argValue);
expect(arg.argLoc.locType).toBe(ProfLocType.TEAM_CONFIG);
expect(arg.argLoc.jsonLoc).toMatch(/^profiles\.(base_glob|LPAR2_home)\.properties\./);
expect(arg.argLoc.osLoc[0]).toEqual(path.normalize(path.join(teamHomeProjDir, `${testAppNm}.config.json`)));
expect([
path.normalize(
path.join(teamHomeProjDir, `${testAppNm}.config.json`)
),
path.normalize(
path.join(teamProjDir, `${testAppNm}.config.json`)
),
]).toContain(arg.argLoc.osLoc[0]);
}
});

Expand Down
4 changes: 0 additions & 4 deletions packages/imperative/src/config/src/ProfileInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1654,16 +1654,12 @@ export class ProfileInfo {
};

let filePath: string;
if (_isPropInLayer(opts.configProperties) && opts.osLocInfo) {
filePath = opts.osLocInfo.path;
} else {
for (const layer of this.mLoadedConfig.mLayers) {
// Find the first layer that includes the JSON path
if (_isPropInLayer(layer.properties)) {
filePath = layer.path;
break;
}
}
}

return [{
Expand Down

0 comments on commit 5b85f22

Please sign in to comment.