Skip to content

Commit

Permalink
Fix stc existence check only checking last one
Browse files Browse the repository at this point in the history
Signed-off-by: 1000TurquoisePogs <[email protected]>
  • Loading branch information
1000TurquoisePogs committed Jun 26, 2024
1 parent e6e9694 commit bbb3272
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bin/commands/init/generate/.errors
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
ZWEL0143E|143|Cannot find data set member %s. You may need to re-run zwe install.
ZWEL0157E|157|%s (%s) is not defined in Zowe YAML configuration file.
ZWEL0318E|318|Configuration stored in PARMLIB must use member name ZWEYAML when using generate action.
ZWEL0319E|319|Configuration stored in PARMLIB must use member name ZWEYAML when using generate action.
2 changes: 1 addition & 1 deletion bin/commands/init/generate/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export function execute(dryRun?: boolean) {
let endIndex = part.indexOf(')', memberIndex);
let member = part.substring(memberIndex+1, endIndex);
if (member.toUpperCase() != 'ZWEYAML') {
common.printErrorAndExit(`ZWEL0318E Configuration stored in PARMLIB must use member name ZWEYAML when using generate action.`, undefined, 318);
common.printErrorAndExit(`ZWEL0319E Configuration stored in PARMLIB must use member name ZWEYAML when using generate action.`, undefined, 319);
}
}
configLines.push('PARMLIB ' + part.substring(0, part.indexOf('(')).replace(/[$]/g, '$$$$'));
Expand Down
7 changes: 3 additions & 4 deletions bin/commands/init/stc/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function execute(allowOverwrite: boolean = false) {
// constants
const COMMAND_LIST = std.getenv('ZWE_CLI_COMMANDS_LIST');

let stcExistence: boolean;
let stcExistence: boolean;

// validation
common.requireZoweYaml();
Expand Down Expand Up @@ -68,13 +68,12 @@ export function execute(allowOverwrite: boolean = false) {

[security_stcs_zowe, security_stcs_zis, security_stcsAux].forEach((mb: string) => {
// STCs in target proclib
stcExistence=zosdataset.isDatasetExists(`${proclib}(${mb})`);
if (stcExistence == true) {
if (zosdataset.isDatasetExists(`${proclib}(${mb})`)) {
stcExistence = true;
if (allowOverwrite) {
// warning
common.printMessage(`Warning ZWEL0300W: ${proclib}(${mb}) already exists. This data set member will be overwritten during configuration.`);
} else {
// common.printErrorAndExit(`Error ZWEL0158E: ${proclib}(${mb}) already exists.`, undefined, 158);
// warning
common.printMessage(`Warning ZWEL0301W: ${proclib}(${mb}) already exists and will not be overwritten. For upgrades, you must use --allow-overwrite.`);
}
Expand Down

0 comments on commit bbb3272

Please sign in to comment.