You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -75,9 +79,6 @@ function Request-AcceleratorConfigurationInput {
75
79
} elseif (Test-Path-Path $bicepYamlPath) {
76
80
$detectedIacType="bicep"
77
81
Write-InformationColored" Detected IaC type: bicep (found platform-landing-zone.yaml)"-ForegroundColor Green -InformationAction Continue
78
-
} else {
79
-
$detectedIacType="bicep-classic"
80
-
Write-InformationColored" Detected IaC type: bicep-classic"-ForegroundColor Green -InformationAction Continue
81
82
}
82
83
83
84
# Detect version control from bootstrap_module_name in inputs.yaml
@@ -99,6 +100,34 @@ function Request-AcceleratorConfigurationInput {
99
100
} catch {
100
101
Write-InformationColored" Warning: inputs.yaml exists but is not valid YAML: $($_.Exception.Message)"-ForegroundColor Yellow -InformationAction Continue
Write-InformationColored"ERROR: Required configuration file not found: inputs.yaml"-ForegroundColor Red -InformationAction Continue
123
+
}
124
+
Write-InformationColored"Please overwrite the folder structure by choosing 'y', or run New-AcceleratorFolderStructure manually."-ForegroundColor Yellow -InformationAction Continue
125
+
return@{
126
+
Continue=$false
127
+
InputConfigFilePaths=@()
128
+
StarterAdditionalFiles=@()
129
+
OutputFolderPath=""
130
+
}
102
131
}
103
132
}
104
133
}
@@ -167,137 +196,90 @@ function Request-AcceleratorConfigurationInput {
167
196
}
168
197
}
169
198
170
-
# Normal mode continues here - prompt for IaC type with detected value as default
$forceResponse=Read-Host"Do you want to recreate it? (y/N)"
256
-
if ($forceResponse-eq"y"-or$forceResponse-eq"Y") {
257
-
$forceFlag=$true
258
-
} else {
259
-
# User wants to keep existing folder - validate config files exist
260
-
$useExistingFolder=$true
261
-
262
-
if (-not (Test-Path-Path $configFolderPath)) {
263
-
Write-InformationColored"ERROR: Config folder not found at '$configFolderPath'"-ForegroundColor Red -InformationAction Continue
264
-
Write-InformationColored"Please create the folder structure first by choosing 'y' to recreate, or run New-AcceleratorFolderStructure manually."-ForegroundColor Yellow -InformationAction Continue
265
-
return@{
266
-
Continue=$false
267
-
InputConfigFilePaths=@()
268
-
StarterAdditionalFiles=@()
269
-
OutputFolderPath=""
270
-
}
228
+
} while ($iacTypeIndex-lt0-or$iacTypeIndex-ge$iacTypeOptions.Count)
229
+
$selectedIacType=$iacTypeOptions[$iacTypeIndex]
230
+
231
+
# Prompt for version control with detected value as default
Write-InformationColored"ERROR: Required configuration file not found: inputs.yaml"-ForegroundColor Red -InformationAction Continue
275
-
Write-InformationColored"Please create the folder structure first by choosing 'y' to recreate, or run New-AcceleratorFolderStructure manually."-ForegroundColor Yellow -InformationAction Continue
276
-
return@{
277
-
Continue=$false
278
-
InputConfigFilePaths=@()
279
-
StarterAdditionalFiles=@()
280
-
OutputFolderPath=""
281
-
}
241
+
Write-InformationColored"`nSelect the Version Control System:"-ForegroundColor Yellow -InformationAction Continue
242
+
for ($i=0; $i-lt$versionControlOptions.Count; $i++) {
throw"Failed to remove existing folder at '$targetFolderPath'. The folder may be locked by another process or you may not have permission to remove it. Please close any applications that may be using files in this folder and try again. Error: $($_.Exception.Message)"
46
+
}
43
47
} else {
44
48
throw"Target folder $targetFolderPath already exists. Please specify a different folder path or remove the existing folder."
0 commit comments