Sha256: 25d91fabe0427e252980dd30b195bc401369434f4531beb006d3df44576bb421

Contents?: true

Size: 1018 Bytes

Versions: 9

Compression:

Stored size: 1018 Bytes

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'
]

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 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

9 entries across 9 versions & 1 rubygems

Version Path
learn-co-3.2.14 bin/learn
learn-co-3.2.13 bin/learn
learn-co-3.2.12 bin/learn
learn-co-3.2.11 bin/learn
learn-co-3.2.10 bin/learn
learn-co-3.2.9 bin/learn
learn-co-3.2.8 bin/learn
learn-co-3.2.7 bin/learn
learn-co-3.2.6 bin/learn