Sha256: 11a4638cb8b32bf7d884d3d95c2190d92cb896cb01aa0ad397b10502908c6387

Contents?: true

Size: 995 Bytes

Versions: 29

Compression:

Stored size: 995 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::Helper.gem_path('fastlane'), '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

29 entries across 29 versions & 1 rubygems

Version Path
fastlane-1.101.0 lib/fastlane/auto_complete.rb
fastlane-1.100.0 lib/fastlane/auto_complete.rb
fastlane-1.99.0 lib/fastlane/auto_complete.rb
fastlane-1.98.0 lib/fastlane/auto_complete.rb
fastlane-1.97.2 lib/fastlane/auto_complete.rb
fastlane-1.97.1 lib/fastlane/auto_complete.rb
fastlane-1.97.0 lib/fastlane/auto_complete.rb
fastlane-1.96.0 lib/fastlane/auto_complete.rb
fastlane-1.95.0 lib/fastlane/auto_complete.rb
fastlane-1.94.1 lib/fastlane/auto_complete.rb
fastlane-1.94.0 lib/fastlane/auto_complete.rb
fastlane-1.93.1 lib/fastlane/auto_complete.rb
fastlane-1.93.0 lib/fastlane/auto_complete.rb
fastlane-1.92.0 lib/fastlane/auto_complete.rb
fastlane-1.92.0.beta2 lib/fastlane/auto_complete.rb
fastlane-1.92.0.beta1 lib/fastlane/auto_complete.rb
fastlane-1.91.0 lib/fastlane/auto_complete.rb
fastlane-1.90.0 lib/fastlane/auto_complete.rb
fastlane-1.89.0 lib/fastlane/auto_complete.rb
fastlane-1.88.0 lib/fastlane/auto_complete.rb