From b16a396f40c0e41006cbf9441e0d0abd7c5b0aae Mon Sep 17 00:00:00 2001 From: Chinmay Das <55234150+chinmdas@users.noreply.github.com> Date: Wed, 18 Dec 2024 19:14:08 +0530 Subject: [PATCH] fallback to team config filepath if osLoc fails to extract profile path Signed-off-by: Chinmay Das <55234150+chinmdas@users.noreply.github.com> --- packages/vsce/src/trees/CICSTree.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/vsce/src/trees/CICSTree.ts b/packages/vsce/src/trees/CICSTree.ts index 0d50bfd..fed1c1f 100644 --- a/packages/vsce/src/trees/CICSTree.ts +++ b/packages/vsce/src/trees/CICSTree.ts @@ -114,10 +114,8 @@ export class CICSTree implements TreeDataProvider { 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; @@ -569,7 +567,9 @@ export class CICSTree implements TreeDataProvider { 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); } }