@@ -502,7 +502,8 @@ ALL_QUESTIONS.push(
502502 ) ) . configureRestore
503503 if ( configureRestore ) {
504504 const env_list_filtered = existingEnvironments . filter ( env => env !== environment ) ;
505- restoreEnvironmentName = ( await prompts (
505+ restoreEnvironmentName = ( await promptAndStoreAnswer (
506+ environment ,
506507 [
507508 {
508509 name : 'restoreEnvironmentName' ,
@@ -517,7 +518,8 @@ ALL_QUESTIONS.push(
517518 validate : ( input : string ) =>
518519 env_list_filtered . includes ( input ) ? true : 'Please select a valid environment.'
519520 }
520- ] . map ( questionToPrompt )
521+ ] ,
522+ existingValues
521523 ) ) . restoreEnvironmentName
522524 }
523525 } else {
@@ -935,10 +937,19 @@ ALL_QUESTIONS.push(
935937 ) ,
936938 scope : 'ENVIRONMENT' as const
937939 } ,
938- ]
939-
940- if ( restoreEnvironmentName ) {
941- applicationServerUpdates . push ( {
940+ {
941+ type : 'VARIABLE' as const ,
942+ name : 'LOGIN_URL' ,
943+ value : allAnswers . restoreEnvironmentName ,
944+ didExist : findExistingValue (
945+ 'LOGIN_URL' ,
946+ 'VARIABLE' ,
947+ 'ENVIRONMENT' ,
948+ existingValues
949+ ) ,
950+ scope : 'ENVIRONMENT' as const
951+ } ,
952+ {
942953 type : 'VARIABLE' as const ,
943954 name : 'RESTORE_ENVIRONMENT_NAME' ,
944955 value : answerOrExisting ( restoreEnvironmentName , findExistingValue (
@@ -954,9 +965,29 @@ ALL_QUESTIONS.push(
954965 existingValues
955966 ) ,
956967 scope : 'ENVIRONMENT' as const
968+ }
969+ ]
970+
971+ // if (restoreEnvironmentName) {
972+ // applicationServerUpdates.push({
973+ // type: 'VARIABLE' as const,
974+ // name: 'RESTORE_ENVIRONMENT_NAME',
975+ // value: answerOrExisting(restoreEnvironmentName, findExistingValue(
976+ // 'RESTORE_ENVIRONMENT_NAME',
977+ // 'VARIABLE',
978+ // 'ENVIRONMENT',
979+ // existingValues
980+ // ), (val) => val || ''),
981+ // didExist: findExistingValue(
982+ // 'RESTORE_ENVIRONMENT_NAME',
983+ // 'VARIABLE',
984+ // 'ENVIRONMENT',
985+ // existingValues
986+ // ),
987+ // scope: 'ENVIRONMENT' as const
957988
958- } )
959- }
989+ // })
990+ // }
960991 if ( enableEncryption ) {
961992 applicationServerUpdates . push ( {
962993 name : 'ENCRYPTION_KEY' ,
0 commit comments