Class: Fastlane::Actions::EnsureBundleExecAction

Inherits:
Fastlane::Action show all
Defined in:
fastlane/lib/fastlane/actions/ensure_bundle_exec.rb

Overview

Raises an exception and stop the lane execution if not using bundle exec to run fastlane

Constant Summary

Constants inherited from Fastlane::Action

Fastlane::Action::AVAILABLE_CATEGORIES, Fastlane::Action::RETURN_TYPES

Documentation collapse

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, authors, deprecated_notes, lane_context, method_missing, other_action, return_type, return_value, sample_return_value, shell_out_should_use_bundle_exec?, step_text

Class Method Details

.authorObject



40
41
42
# File 'fastlane/lib/fastlane/actions/ensure_bundle_exec.rb', line 40

def self.author
  ['rishabhtayal']
end

.available_optionsObject



32
33
34
# File 'fastlane/lib/fastlane/actions/ensure_bundle_exec.rb', line 32

def self.available_options
  []
end

.categoryObject



50
51
52
# File 'fastlane/lib/fastlane/actions/ensure_bundle_exec.rb', line 50

def self.category
  :misc
end

.descriptionObject



21
22
23
# File 'fastlane/lib/fastlane/actions/ensure_bundle_exec.rb', line 21

def self.description
  "Raises an exception if not using `bundle exec` to run fastlane"
end

.detailsObject



25
26
27
28
29
30
# File 'fastlane/lib/fastlane/actions/ensure_bundle_exec.rb', line 25

def self.details
  [
    "This action will check if you are using bundle exec to run fastlane.",
    "You can put it into `before_all` and make sure that fastlane is run using `bundle exec fastlane` command."
  ].join("\n")
end

.example_codeObject



44
45
46
47
48
# File 'fastlane/lib/fastlane/actions/ensure_bundle_exec.rb', line 44

def self.example_code
  [
    "ensure_bundle_exec"
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:



54
55
56
# File 'fastlane/lib/fastlane/actions/ensure_bundle_exec.rb', line 54

def self.is_supported?(platform)
  true
end

.outputObject



36
37
38
# File 'fastlane/lib/fastlane/actions/ensure_bundle_exec.rb', line 36

def self.output
  []
end

.run(params) ⇒ Object



8
9
10
11
12
13
14
15
# File 'fastlane/lib/fastlane/actions/ensure_bundle_exec.rb', line 8

def self.run(params)
  return if PluginManager.new.gemfile_path.nil?
  if FastlaneCore::Helper.bundler?
    UI.success("Using bundled fastlane ✅")
  else
    UI.user_error!("fastlane detected a Gemfile in the current directory. However it seems like you don't use `bundle exec`. Use `bundle exec fastlane #{ARGV.join(' ')}`")
  end
end