From 662a57cd4c6b4ac81ff1a698e3381026ffcc5416 Mon Sep 17 00:00:00 2001 From: Manish Rathi Date: Tue, 15 Jun 2021 22:19:37 +0200 Subject: [PATCH] [action][git_add] remove all instances of `is_string` in options and use `type` (#18882) * [action][git_add] remove all instances of `is_string` in options and use `type` * Making `test_sample_code` happy * Happy linting * Happy linting * Undo commented out examples Co-authored-by: Josh Holtz --- fastlane/lib/fastlane/actions/git_add.rb | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/fastlane/lib/fastlane/actions/git_add.rb b/fastlane/lib/fastlane/actions/git_add.rb index a10f14fa48b..d0c92d76c07 100644 --- a/fastlane/lib/fastlane/actions/git_add.rb +++ b/fastlane/lib/fastlane/actions/git_add.rb @@ -8,13 +8,9 @@ def self.run(params) paths = params[:pathspec] success_message = "Successfully added from \"#{paths}\" 💾." elsif params[:path] - if params[:path].kind_of?(String) - paths = shell_escape(params[:path], should_escape) - elsif params[:path].kind_of?(Array) - paths = params[:path].map do |p| - shell_escape(p, should_escape) - end.join(' ') - end + paths = params[:path].map do |p| + shell_escape(p, should_escape) + end.join(' ') success_message = "Successfully added \"#{paths}\" 💾." else paths = "." @@ -43,18 +39,17 @@ def self.available_options [ FastlaneCore::ConfigItem.new(key: :path, description: "The file(s) and path(s) you want to add", - is_string: false, + type: Array, conflicting_options: [:pathspec], optional: true), FastlaneCore::ConfigItem.new(key: :shell_escape, description: "Shell escapes paths (set to false if using wildcards or manually escaping spaces in :path)", - is_string: false, + type: Boolean, default_value: true, optional: true), # Deprecated FastlaneCore::ConfigItem.new(key: :pathspec, description: "The pathspec you want to add files from", - is_string: true, conflicting_options: [:path], optional: true, deprecated: "Use `--path` instead")