Skip to content

Commit 14d34d2

Browse files
authored
Handle no TSO profile during zowe-api-dev init (#121)
* Handle null TSO profile
1 parent 1ded6f7 commit 14d34d2

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

zowe-api-dev/src/commands/init.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,13 @@ export default class Init extends Command {
6262
const defaultZosmfProfile = getDefaultProfile("zosmf");
6363
if (f.account === "ACCT") {
6464
const defaultTsoProfile = getDefaultProfile("tso");
65-
const account = defaultTsoProfile.profile.account;
66-
if (account) {
67-
f.account = account;
68-
} else {
65+
if (defaultTsoProfile) {
66+
const account = defaultTsoProfile.profile.account;
67+
if (account) {
68+
f.account = account;
69+
}
70+
}
71+
if (!f.account || f.account === "ACCT") {
6972
this.log(logSymbols.warning, "Accounting information not found in your Zowe TSO profile. Please substitute 'ACCT' string with your accounting information in user-zowe-api.json manually.")
7073
}
7174
}

0 commit comments

Comments
 (0)