# frozen_string_literal: true module Jive class Project attr_reader :path def initialize(path) @path = path end def bootstrap(shell) tasks = [] tasks << [:asdf, "install"] tasks << [:bundle, "install"] if bundler? tasks << [:yarn, "install"] if yarn? shell.run_safely do shell.run_each(tasks) end end private def bundler? path.join("Gemfile").exist? || path.glob("*.gemspec").any? end def yarn? path.join("yarn.lock").exist? end end end