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
ifconstrains.Check(element) { // Validate a version against a constraint
173
-
tfversion:=element.String()
174
-
ifValidVersionFormat(tfversion) { // check if version format is correct
175
-
out, err:=Install(tfversion, mirrorURL)
176
-
iferr!=nil {
177
-
log.Printf("Error during install %v", err)
178
-
os.Exit(1)
179
-
}
180
-
181
-
returnout
182
-
}
183
-
log.Errorf("Invalid terraform version format.")
171
+
// Validate a version against a constraint
172
+
if!constrains.Check(element) {
173
+
continue
174
+
}
175
+
tfversion:=element.String()
176
+
177
+
// check if version format is correct
178
+
if!ValidVersionFormat(tfversion) {
179
+
log.Debugf("Version not with invalid format %v", tfversion)
180
+
181
+
continue
182
+
}
183
+
out, err:=Install(tfversion, mirrorURL)
184
+
iferr!=nil {
185
+
log.Printf("Error during install %v", err)
184
186
os.Exit(1)
185
187
}
188
+
189
+
returnout
186
190
}
187
191
188
192
log.Errorf("No version found to match constraint. Follow the README.md instructions for setup. https://github.com/terraform-tools/simple-tfswitch/blob/main/README.md")
0 commit comments