fastlane/lib/fastlane/swift_fastlane_function.rb in fastlane-2.185.0 vs fastlane/lib/fastlane/swift_fastlane_function.rb in fastlane-2.185.1

- old
+ new

@@ -193,11 +193,11 @@ if default_value.nil? "#{param}: #{type}" else if type == "((String) -> Void)?" "#{param}: #{type} = nil" - elsif optional && type.end_with?('?') && !type.start_with?('Any') + elsif optional && type.end_with?('?') && !type.start_with?('Any') || type.start_with?('Bool') "#{param}: OptionalConfigValue<#{type}> = .fastlaneDefault(#{default_value})" else "#{param}: #{type} = #{default_value}" end end @@ -284,11 +284,11 @@ type = get_type(param: name, default_value: default_value, optional: is_optional, param_type_override: type_override, is_string: is_string) sanitized_name = camel_case_lower(string: name) sanitized_name = sanitize_reserved_word(word: sanitized_name) type_string = type_override == :string_callback ? ".stringClosure" : "nil" - if !(type_override == :string_callback || !(is_optional && default_value.nil? && !type.start_with?('Any'))) + if !(type_override == :string_callback || !(is_optional && default_value.nil? && !type.start_with?('Any') || type.start_with?('Bool'))) { name: "#{sanitized_name.gsub('`', '')}Arg", arg: "let #{sanitized_name.gsub('`', '')}Arg = #{sanitized_name}.asRubyArgument(name: \"#{name}\", type: #{type_string})" } else { name: "#{sanitized_name.gsub('`', '')}Arg", arg: "let #{sanitized_name.gsub('`', '')}Arg = RubyCommand.Argument(name: \"#{name}\", value: #{sanitized_name}, type: #{type_string})" } end end @@ -432,10 +432,10 @@ param = sanitize_reserved_word(word: param) static_var_for_parameter_name = param if type == "((String) -> Void)?" "#{param}: #{type} = nil" - elsif optional && type.end_with?('?') && !type.start_with?('Any') + elsif (optional && type.end_with?('?') && !type.start_with?('Any')) || type.start_with?('Bool') "#{param}: OptionalConfigValue<#{type}> = .fastlaneDefault(#{self.class_name.downcase}.#{static_var_for_parameter_name})" else "#{param}: #{type} = #{self.class_name.downcase}.#{static_var_for_parameter_name}" end end