From e3562fac5d53274d3167c42eb28234fb1cd6e383 Mon Sep 17 00:00:00 2001 From: Michael Rebello Date: Tue, 17 Jan 2023 12:41:53 -0800 Subject: [PATCH] Fix generating with no options in `buf.gen.yaml` Fixes the following error which is thrown when no `opt` is specified in `buf.gen.yaml`: > unknownParameter(string: "") --- Plugins/ConnectPluginUtilities/GeneratorOptions.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Plugins/ConnectPluginUtilities/GeneratorOptions.swift b/Plugins/ConnectPluginUtilities/GeneratorOptions.swift index 4bbb1565..493236de 100644 --- a/Plugins/ConnectPluginUtilities/GeneratorOptions.swift +++ b/Plugins/ConnectPluginUtilities/GeneratorOptions.swift @@ -46,6 +46,10 @@ private enum CommandLineParameter: String { return try commandLineParameters .components(separatedBy: ",") .compactMap { parameter in + if parameter.isEmpty { + return nil + } + guard let index = parameter.firstIndex(of: "=") else { throw Error.unknownParameter(string: parameter) }