@suitegeezus/suitecloud-cli 3.1.6-3 → 3.1.6-4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/CLI.js +16 -14
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suitegeezus/suitecloud-cli",
3
- "version": "3.1.6-3",
3
+ "version": "3.1.6-4",
4
4
  "license": "UPL-1.0",
5
5
  "description": "SuiteCloud CLI for Node.js",
6
6
  "keywords": [
package/src/CLI.js CHANGED
@@ -157,7 +157,7 @@ module.exports = class CLI {
157
157
  .option(
158
158
  `${INTERACTIVE_ALIAS}, ${INTERACTIVE_OPTION}`,
159
159
  NodeTranslationService.getMessage(INTERACTIVE_OPTION_DESCRIPTION),
160
- this._validateInteractive(commandMetadataList[thirdArgument].options)
160
+ this._validateInteractive(commandMetadataList[thirdArgument]?.options)
161
161
  )
162
162
  .helpOption(`${HELP_ALIAS}, ${HELP_OPTION}`, NodeTranslationService.getMessage(COMMAND_OPTIONS.HELP))
163
163
  .addHelpCommand(`${HELP_COMMAND} ${COMMAND_ALIAS}`, NodeTranslationService.getMessage(COMMAND_OPTIONS.HELP))
@@ -187,19 +187,21 @@ module.exports = class CLI {
187
187
 
188
188
  _validateInteractive(additionalOptions) {
189
189
  let additionalAllowed = 0;
190
- const ubiquitousValuesThatAreInteractive = Object.values(UBIQUITOUS_OPTIONS)
191
- .concat(Object.values(additionalOptions))
192
- .filter((o)=>o.allowInteractive)
193
- .map((o)=>({
194
- name: o.name,
195
- additionalAllowed: o.type === "SINGLE" ? 2 : 1
196
- }))
197
- process.argv.forEach((arg)=>{
198
- const mactchingOption = ubiquitousValuesThatAreInteractive.find(
199
- (o)=>(`--${o.name}` === arg)
200
- );
201
- additionalAllowed += mactchingOption?.additionalAllowed || 0;
202
- });
190
+ if( additionalOptions) {
191
+ const ubiquitousValuesThatAreInteractive = Object.values(UBIQUITOUS_OPTIONS)
192
+ .concat(Object.values(additionalOptions))
193
+ .filter((o) => o.allowInteractive)
194
+ .map((o) => ({
195
+ name: o.name,
196
+ additionalAllowed: o.type === "SINGLE" ? 2 : 1
197
+ }))
198
+ process.argv.forEach((arg) => {
199
+ const mactchingOption = ubiquitousValuesThatAreInteractive.find(
200
+ (o) => (`--${o.name}` === arg)
201
+ );
202
+ additionalAllowed += mactchingOption?.additionalAllowed || 0;
203
+ });
204
+ }
203
205
  return ()=> {
204
206
  if (process.argv.length > (4 + additionalAllowed)) {
205
207
  // There are more options apart from -i or --interactive