class NewlineHw::Shell::Runners::Javascript
Build a shell command that is dependent on files of a project being present that are UNOPINIONATED about how to setup / start a JS project
Public Instance Methods
npm?()
click to toggle source
# File lib/newline_hw/shell/runners/javascript.rb, line 8 def npm? file?("package.json") end
prepare_commands()
click to toggle source
# File lib/newline_hw/shell/runners/javascript.rb, line 16 def prepare_commands add_command "yarn" if yarn? add_command "npm install" if npm? && !yarn? end
yarn?()
click to toggle source
# File lib/newline_hw/shell/runners/javascript.rb, line 12 def yarn? file?("yarn.lock") end