Skip to content

Commit

Permalink
fallback to team config filepath if osLoc fails to extract profile path
Browse files Browse the repository at this point in the history
Signed-off-by: Chinmay Das <[email protected]>
  • Loading branch information
chinmdas authored Dec 18, 2024
1 parent 89c64c4 commit b16a396
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/vsce/src/trees/CICSTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,8 @@ export class CICSTree implements TreeDataProvider<CICSSessionTree> {
const profiles = configInstance.getAllProfiles();
const currentProfile =
profiles.length > 0 ? await ProfileManagement.getProfilesCache().getProfileFromConfig(profiles[0].profName) : null;
const filePath =
currentProfile === null
? configInstance.getTeamConfig().opts.homeDir + "/zowe.config.json"
: (currentProfile.profLoc.osLoc?.[0]);
const teamConfigFilePath = configInstance.getTeamConfig().opts.homeDir + "/zowe.config.json";
const filePath = currentProfile === null ? teamConfigFilePath : (currentProfile?.profLoc.osLoc?.[0] ?? teamConfigFilePath);
await openConfigFile(filePath);
} else {
let profileToLoad;
Expand Down Expand Up @@ -569,7 +567,9 @@ export class CICSTree implements TreeDataProvider<CICSSessionTree> {
placeHolder: "Create a New Team Configuration File",
});
if (response) {
const filePath = profile.profLoc.osLoc?.[0];
const configInstance = await ProfileManagement.getConfigInstance();
const teamConfigFilePath = configInstance.getTeamConfig().opts.homeDir + "/zowe.config.json";
const filePath = profile?.profLoc.osLoc?.[0] ?? teamConfigFilePath;
await openConfigFile(filePath);
}
}
Expand Down

0 comments on commit b16a396

Please sign in to comment.