Applied feedback from review pt. 2

Signed-off-by: MrJack <36191829+biagiopietro@users.noreply.github.com>
pull/31615/head
MrJack 8 months ago
parent 0f705e94b5
commit a030a7d538

@ -157,8 +157,13 @@ func NewForSource(source, version string) (installer Installer, err error) {
}
// FindSource determines the correct Installer for the given source.
func FindSource(location string, version string) (Installer, error) {
installer, err := existingVCSRepo(location, version)
// Version is optional; if not provided, it defaults to empty string.
func FindSource(location string, version ...string) (Installer, error) {
v := ""
if len(version) > 0 {
v = version[0]
}
installer, err := existingVCSRepo(location, v)
if err != nil && err.Error() == "Cannot detect VCS" {
slog.Warn(
"cannot get information about plugin source",

Loading…
Cancel
Save