Class: Ddenv::Goals::NpmPackesInstalled

Inherits:
Ddenv::Goal show all
Defined in:
lib/ddenv/goals/npm_packages_installed.rb

Instance Method Summary collapse

Methods inherited from Ddenv::Goal

#==, #eql?, #hash, #initialize, #post_goals, #pre_goals, #props, #with_pre_and_post_goals

Constructor Details

This class inherits a constructor from Ddenv::Goal

Instance Method Details

#achieveObject



19
20
21
22
23
# File 'lib/ddenv/goals/npm_packages_installed.rb', line 19

def achieve
  # TODO: use :pretty when passing --verbose
  cmd = TTY::Command.new(printer: :null)
  cmd.run("shadowenv", "exec", "--", "npm", "install")
end

#achieved?Boolean

Returns:

  • (Boolean)


10
11
12
13
14
15
16
17
# File 'lib/ddenv/goals/npm_packages_installed.rb', line 10

def achieved?
  # TODO: use :pretty when passing --verbose
  cmd = TTY::Command.new(printer: :null)
  cmd.run("shadowenv", "exec", "--", "npx", "check-dependencies")
  true
rescue StandardError
  false
end

#messageObject



6
7
8
# File 'lib/ddenv/goals/npm_packages_installed.rb', line 6

def message
  "Installing npm packages"
end