@@ -28,7 +28,7 @@ import { createExitPrompter } from '../ui/common/exitPrompter'
2828import { getConfigFileUri , SamConfig , validateSamSyncConfig , writeSamconfigGlobal } from './config'
2929import { cast , Optional } from '../utilities/typeConstructors'
3030import { pushIf , toRecord } from '../utilities/collectionUtils'
31- import { getOverriddenParameters } from '../../lambda/config/parameterUtils'
31+ import { getOverriddenParameters , getParameters } from '../../lambda/config/parameterUtils'
3232import { addTelemetryEnvVar } from './cli/samCliInvokerUtils'
3333import { samSyncParamUrl , samSyncUrl , samUpgradeUrl } from '../constants'
3434import { openUrl } from '../utilities/vsCodeUtils'
@@ -54,6 +54,7 @@ import { BucketSource, createBucketNamePrompter } from '../ui/sam/bucketPrompter
5454import { runInTerminal } from './processTerminal'
5555import { WizardPrompter } from '../ui/wizardPrompter'
5656import { TemplateParametersWizard } from '../../awsService/appBuilder/wizards/templateParametersWizard'
57+ import { SkipPrompter } from '../ui/common/skipPrompter'
5758
5859export interface SyncParams {
5960 readonly paramsSource : ParamsSource
@@ -160,10 +161,13 @@ export class SyncWizard extends Wizard<SyncParams> {
160161 super ( { initState : state , exitPrompterProvider : shouldPromptExit ? createExitPrompter : undefined } )
161162 this . registry = registry
162163 this . form . template . bindPrompter ( ( ) => createTemplatePrompter ( this . registry , syncMementoRootKey ) )
163- this . form . templateParameters . bindPrompter (
164- ( { template } ) =>
165- new WizardPrompter ( new TemplateParametersWizard ( template ! . uri , samSyncUrl , syncMementoRootKey ) )
166- )
164+ this . form . templateParameters . bindPrompter ( async ( { template } ) => {
165+ const samTemplateParameters = await getParameters ( template ! . uri )
166+ if ( ! samTemplateParameters || samTemplateParameters . size === 0 ) {
167+ return new SkipPrompter ( { } as Partial < any > )
168+ }
169+ return new WizardPrompter ( new TemplateParametersWizard ( template ! . uri , samSyncParamUrl , syncMementoRootKey ) )
170+ } )
167171
168172 this . form . projectRoot . setDefault ( ( { template } ) => getProjectRoot ( template ) )
169173
0 commit comments