Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug/1273 bu selection wizard should be disabled if skipinteraction is active #1279

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions lib/util/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,11 @@ const Cli = {
} else if (!credential || !properties.credentials[credential]) {
// no or unknown credential provided; BU either to be selected or pre-selected
if (credential !== null) {
Util.logger.warn(`Credential '${credential}' not found`);
const msg = `Credential '${credential}' not found`;
if (Util.skipInteraction) {
throw new Error(msg);
}
Util.logger.warn(msg);
}
const response = await this._selectBU(
properties,
Expand All @@ -196,10 +200,13 @@ const Cli = {
) {
// correct credential provided but BU still needed
if (businessUnit && businessUnit !== 'undefined') {
Util.logger.warn(
`Business Unit '${businessUnit}' not found for credential '${credential}'`
);
const msg = `Business Unit '${businessUnit}' not found for credential '${credential}'`;
if (Util.skipInteraction) {
throw new Error(msg);
}
Util.logger.warn(msg);
}

const response = await this._selectBU(properties, credential, null, allowAll);
businessUnit = response.businessUnit;
Util.logger.info(
Expand Down
Loading