Skip prompting for platform and appType when only one option available#325
Merged
wmathurin merged 1 commit intoApr 10, 2026
Merged
Conversation
a74e3a2 to
d5f719e
Compare
When a CLI tool has only one platform (e.g., forceios has only 'ios') or only one appType, skip the interactive prompt and automatically use that single option. This improves the user experience by reducing unnecessary prompts, and also future-proofs the CLI tools - if templates are removed such that a CLI ends up with only one appType option, the prompting will automatically be skipped without requiring any code changes. Changes: - Modified configHelper.js to apply cli context to promptIf via applyCli() - Added promptIf functions to platform and appType arguments in constants.js that check if there's more than one option before prompting
d5f719e to
377c554
Compare
wmathurin
added a commit
to wmathurin/SalesforceMobileSDK-Package
that referenced
this pull request
Apr 10, 2026
Updated after removing iOSNativeTemplate and AndroidNativeTemplate from Templates repository. The native appType has been completely eliminated, with native_swift and native_kotlin remaining as the modern alternatives. Changes: - setup_test_branches.js: Removed native templates from templatesPackageJsons array - constants.js: Removed 'native' from forceios and forcedroid appTypes and appTypesToPath - test_force.js: Removed 'native' from APP_TYPE enum - Regenerated OCLIF commands for SFDX plugin - Updated SFDX README (with expected errors for uninstalled plugin) - Updated CLAUDE.md documentation example to reflect new structure With only one appType remaining for forceios and forcedroid, the appType prompt will be automatically skipped (via PR forcedotcom#325 changes).
bbirman
approved these changes
Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
promptIffunctions to use consistent curried patternChanges
configHelper.js
applyCli()function - it now handles allpromptIffunctions consistentlypromptIfis applied viaapplyCli()like all other function-valued argumentsconstants.js
promptIf: cli => otherArgs => cli.platforms.length > 1toplatformargumentpromptIf: cli => otherArgs => cli.appTypes.length > 1toappTypeargumentdescriptionandlongDescriptionforappTypeto return empty string when only one optionpromptIffunctions to use consistent curried patterncli => otherArgs => ...templateRepoUri,templateSource,template,startPagenow all follow the same patterncliparameterBehavior
Before: Always prompted for platform/appType even with single option
After: Automatically uses the single option without prompting
Examples
Testing
Related
Supports the template removal workflow - when removing templates leaves a CLI with only one appType, prompting is automatically skipped with no additional code changes needed.