Class: Phare::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/phare/cli.rb

Instance Method Summary collapse

Constructor Details

#initialize(env) ⇒ CLI

Returns a new instance of CLI.



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/phare/cli.rb', line 3

def initialize(env)
  if env['SKIP_CODE_CHECK']
    puts '--------------------------------------------------------'
    puts 'Skipping code style checking… Really? Well alright then…'
    puts '--------------------------------------------------------'

    exit 0
  else
    if Phare::Check.new(Dir.getwd).tap { |c| c.run }.status == 0
      puts '------------------------------------------'
      puts 'Everything looks good, keep on committing!'
      puts '------------------------------------------'

      exit 0
    else
      puts '------------------------------------------------------------------------'
      puts 'Something’s wrong with your code style. Please fix it before committing.'
      puts '------------------------------------------------------------------------'

      exit 1
    end
  end
end