Sha256: c12835372123004cbf325de97700bc31fde3ba5b98444ec7db42ee005838a99a

Contents?: true

Size: 1.1 KB

Versions: 27

Compression:

Stored size: 1.1 KB

Contents

#!/usr/bin/env ruby

require 'learn'

NON_PRE_CONFIG_COMMANDS = [
  'reset', 'whoami', 'directory', 'help', 'version', '--version', '-v', 'doctor', 'new', 'hello', 'lint', 'save'
]

INTERNET_REQUIRED_COMMANDS = [
  'whoami', 'doctor', 'directory', 'reset', 'hello'
]

LEARN_CONFIG_COMMANDS = ['reset', 'whoami', 'directory']

if ['-v', '--version'].include?(ARGV.first)
  puts Learn::VERSION
  exit
end

Learn::OptionsSanitizer.new(ARGV).sanitize!

# Legacy: leaving this in just in case we do decide to return to our previously
#         extra-defensive auth checking
# if !(NON_PRE_CONFIG_COMMANDS.include?(ARGV[0]))
  # system('learn-config') unless Learn::InternetConnection.no_internet_connection?
# end

netrc = Learn::NetrcInteractor.new
netrc.read
token = netrc.password

if !LEARN_CONFIG_COMMANDS.include?(ARGV[0]) && (token.nil? || token == 'machine' || !File.exist?(File.expand_path('~/.learn-config')))
  system('learn-config') unless Learn::InternetConnection.no_internet_connection?
end

if INTERNET_REQUIRED_COMMANDS.include?(ARGV[0])
  Learn::InternetConnection.test_connection
end

Learn::CLI.start(ARGV)

Version data entries

27 entries across 27 versions & 2 rubygems

Version Path
learn-co-3.8.1 bin/learn
learn-co-3.8.0 bin/learn
learn-co-dev-0.0.2 bin/learn-dev
learn-co-dev-0.0.1 bin/learn-dev
learn-co-3.8.0.rc1 bin/learn
learn-co-3.7.0 bin/learn
learn-co-3.6.1 bin/learn
learn-co-3.6.0 bin/learn
learn-co-3.5.4 bin/learn
learn-co-3.5.3 bin/learn
learn-co-3.5.2 bin/learn
learn-co-3.5.1 bin/learn
learn-co-3.5.0 bin/learn
learn-co-3.4.5 bin/learn
learn-co-3.4.4 bin/learn
learn-co-3.4.3 bin/learn
learn-co-3.4.2 bin/learn
learn-co-3.4.1 bin/learn
learn-co-3.4.0 bin/learn
learn-co-3.3.0 bin/learn