Skip to content

Commit

Permalink
Fix hardcoded fastlane paths (#8380)
Browse files Browse the repository at this point in the history
* Replace uses of hard-coded './fastlane' path with `FastlaneCore::FastlaneFolder.path`

* Fix mock path in test command generate specs
  • Loading branch information
mgrebenets committed Mar 28, 2017
1 parent 602c302 commit da1f754
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions deliver/lib/deliver/commands_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def run
options = FastlaneCore::Configuration.create(deliverfile_options(skip_verification: true), options.__hash__)
options.load_configuration_file("Deliverfile")
Deliver::Runner.new(options, skip_version: true) # to login...
containing = FastlaneCore::Helper.fastlane_enabled? ? './fastlane' : '.'
containing = FastlaneCore::Helper.fastlane_enabled? ? FastlaneCore::FastlaneFolder.path : '.'
path = options[:screenshots_path] || File.join(containing, 'screenshots')
Deliver::DownloadScreenshots.run(options, path)
end
Expand All @@ -140,7 +140,7 @@ def run
options = FastlaneCore::Configuration.create(deliverfile_options(skip_verification: true), options.__hash__)
options.load_configuration_file("Deliverfile")
Deliver::Runner.new(options) # to login...
containing = FastlaneCore::Helper.fastlane_enabled? ? './fastlane' : '.'
containing = FastlaneCore::Helper.fastlane_enabled? ? FastlaneCore::FastlaneFolder.path : '.'
path = options[:metadata_path] || File.join(containing, 'metadata')
res = ENV["DELIVER_FORCE_OVERWRITE"]
res ||= UI.confirm("Do you want to overwrite existing metadata on path '#{File.expand_path(path)}'?")
Expand Down
2 changes: 1 addition & 1 deletion scan/lib/scan/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def self.verify_type(item_name, acceptable_types, value)
end

def self.available_options
containing = Helper.fastlane_enabled? ? './fastlane' : '.'
containing = Helper.fastlane_enabled? ? FastlaneCore::FastlaneFolder.path : '.'

[
FastlaneCore::ConfigItem.new(key: :workspace,
Expand Down
4 changes: 2 additions & 2 deletions scan/spec/test_command_generator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@

describe "Supports toolchain" do
it "should fail if :xctestrun and :toolchain is set" do
allow(FastlaneCore::FastlaneFolder).to receive(:path).and_return(nil)
allow(FastlaneCore::FastlaneFolder).to receive(:path).and_return(".")
expect do
Fastlane::FastFile.new.parse("lane :test do
scan(
Expand Down Expand Up @@ -429,7 +429,7 @@
])
end
it "should raise an exception if two build_modes are set" do
allow(FastlaneCore::FastlaneFolder).to receive(:path).and_return(nil)
allow(FastlaneCore::FastlaneFolder).to receive(:path).and_return(".")
expect do
Fastlane::FastFile.new.parse("lane :test do
scan(
Expand Down
2 changes: 1 addition & 1 deletion screengrab/lib/screengrab/commands_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def run

c.action do |args, options|
require 'screengrab/setup'
path = (Screengrab::Helper.fastlane_enabled? ? './fastlane' : '.')
path = Screengrab::Helper.fastlane_enabled? ? FastlaneCore::FastlaneFolder.path : '.'
Screengrab::Setup.create(path)
end
end
Expand Down
2 changes: 1 addition & 1 deletion snapshot/lib/snapshot/commands_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def run

c.action do |args, options|
require 'snapshot/setup'
path = (Snapshot::Helper.fastlane_enabled? ? './fastlane' : '.')
path = Snapshot::Helper.fastlane_enabled? ? FastlaneCore::FastlaneFolder.path : '.'
Snapshot::Setup.create(path)
end
end
Expand Down

0 comments on commit da1f754

Please sign in to comment.