Skip to content

Commit

Permalink
[action][git_add] remove all instances of is_string in options and …
Browse files Browse the repository at this point in the history
…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 <josh@rokkincat.com>
  • Loading branch information
crazymanish and Josh Holtz committed Jun 15, 2021
1 parent ec7625e commit 662a57c
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions fastlane/lib/fastlane/actions/git_add.rb
Expand Up @@ -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 = "."
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 662a57c

Please sign in to comment.