lib/ember_cli/path_set.rb in ember-cli-rails-0.8.2 vs lib/ember_cli/path_set.rb in ember-cli-rails-0.8.3

- old
+ new

@@ -43,11 +43,11 @@ No `ember-cli` executable found for `#{app_name}`. Install it: $ cd #{root} - $ npm install + $ #{package_manager} install MSG end end end end @@ -84,10 +84,16 @@ def npm @npm ||= app_options.fetch(:npm_path) { which("npm") } end + def yarn + if yarn? + @yarn ||= app_options.fetch(:yarn_path) { which("yarn") } + end + end + def node_modules @node_modules ||= root.join("node_modules") end def tee @@ -99,9 +105,21 @@ end private attr_reader :app, :ember_cli_root, :environment, :rails_root + + def package_manager + if yarn? + "yarn" + else + "npm" + end + end + + def yarn? + app_options[:yarn] || app_options[:yarn_path] + end def app_name app.name end