Sha256: fd2f5b6eb3ccdce8f0ec82722c77396ef828a1cdf3fc16611921791a2c12c7ed

Contents?: true

Size: 972 Bytes

Versions: 97

Compression:

Stored size: 972 Bytes

Contents

require 'fileutils'

module Fastlane
  # Enable tab auto completion
  class AutoComplete
    def self.execute
      fastlane_conf_dir = "~/.fastlane"
      confirm = UI.confirm "This will copy a shell script into #{fastlane_conf_dir} that provides the command tab completion. Sound good?"
      return unless confirm

      # create the ~/.fastlane directory
      fastlane_conf_dir = File.expand_path fastlane_conf_dir
      FileUtils.mkdir_p fastlane_conf_dir

      # then copy all of the completions files into it from the gem
      completion_script_path = File.join(Fastlane::ROOT, 'lib', 'assets', 'completions')
      FileUtils.cp_r completion_script_path, fastlane_conf_dir

      UI.success "Copied! To use auto complete for fastlane, add the following line to your favorite rc file (e.g. ~/.bashrc)"
      UI.important "  . ~/.fastlane/completions/completion.sh"
      UI.success "Don't forget to source that file in your current shell! 🐚"
    end
  end
end

Version data entries

97 entries across 97 versions & 1 rubygems

Version Path
fastlane-2.20.0.beta.20170309010049 fastlane/lib/fastlane/auto_complete.rb
fastlane-2.20.0.beta.20170308010036 fastlane/lib/fastlane/auto_complete.rb
fastlane-2.19.3 fastlane/lib/fastlane/auto_complete.rb
fastlane-2.20.0.beta.20170307010029 fastlane/lib/fastlane/auto_complete.rb
fastlane-2.19.2 fastlane/lib/fastlane/auto_complete.rb
fastlane-2.20.0.beta.20170306010752 fastlane/lib/fastlane/auto_complete.rb
fastlane-2.20.0.beta.20170305010057 fastlane/lib/fastlane/auto_complete.rb
fastlane-2.20.0.beta.20170304010023 fastlane/lib/fastlane/auto_complete.rb
fastlane-2.20.0.beta.20170303010054 fastlane/lib/fastlane/auto_complete.rb
fastlane-2.20.0.beta.20170302010029 fastlane/lib/fastlane/auto_complete.rb
fastlane-2.19.1 fastlane/lib/fastlane/auto_complete.rb
fastlane-2.19.0 fastlane/lib/fastlane/auto_complete.rb
fastlane-2.19.0.beta.20170301010932 fastlane/lib/fastlane/auto_complete.rb
fastlane-2.19.0.beta.20170228010016 fastlane/lib/fastlane/auto_complete.rb
fastlane-2.19.0.beta.20170227010016 fastlane/lib/fastlane/auto_complete.rb
fastlane-2.19.0.beta.20170226010028 fastlane/lib/fastlane/auto_complete.rb
fastlane-2.19.0.beta.20170225010031 fastlane/lib/fastlane/auto_complete.rb
fastlane-2.19.0.beta.20170224010025 fastlane/lib/fastlane/auto_complete.rb
fastlane-2.18.3 fastlane/lib/fastlane/auto_complete.rb
fastlane-2.19.0.beta.20170223010028 fastlane/lib/fastlane/auto_complete.rb