Skip to content
This repository has been archived by the owner on Oct 2, 2018. It is now read-only.

Commit

Permalink
Merge pull request #205 from olegoid/master
Browse files Browse the repository at this point in the history
Use conflicting options mechanism for workspace and project paths
  • Loading branch information
KrauseFx committed Feb 9, 2016
2 parents cb7e4e7 + 34f30a9 commit 12a01a4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions lib/gym/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ def self.plain_options
UI.user_error!("Workspace file not found at path '#{v}'") unless File.exist?(v)
UI.user_error!("Workspace file invalid") unless File.directory?(v)
UI.user_error!("Workspace file is not a workspace, must end with .xcworkspace") unless v.include?(".xcworkspace")
end,
conflicting_options: [:project],
conflict_block: proc do |value|
UI.user_error!("You can only pass either a 'workspace' or a '#{value.key}', not both")
end),
FastlaneCore::ConfigItem.new(key: :project,
short_option: "-p",
Expand All @@ -32,6 +36,10 @@ def self.plain_options
UI.user_error!("Project file not found at path '#{v}'") unless File.exist?(v)
UI.user_error!("Project file invalid") unless File.directory?(v)
UI.user_error!("Project file is not a project file, must end with .xcodeproj") unless v.include?(".xcodeproj")
end,
conflicting_options: [:workspace],
conflict_block: proc do |value|
UI.user_error!("You can only pass either a 'project' or a '#{value.key}', not both")
end),
FastlaneCore::ConfigItem.new(key: :scheme,
short_option: "-s",
Expand Down
2 changes: 1 addition & 1 deletion spec/options_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
expect do
options = { project: "./examples/standard/Example.xcodeproj", workspace: "./examples/cocoapods/Example.xcworkspace" }
Gym.config = FastlaneCore::Configuration.create(Gym::Options.available_options, options)
end.to raise_error "You can only pass either a workspace or a project path, not both".red
end.to raise_error "You can only pass either a 'project' or a 'workspace', not both"
end

it "removes the `ipa` from the output name if given" do
Expand Down

0 comments on commit 12a01a4

Please sign in to comment.