Skip to content
This repository was archived by the owner on Oct 19, 2018. It is now read-only.

Commit f56d1ac

Browse files
committed
1 parent 57d30ff commit f56d1ac

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

lib/generators/hyperloop/install_bootstrap_generator.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ class InstallBootstrapGenerator < Rails::Generators::Base
77
class_option 'no-build', type: :boolean
88

99
def insure_yarn_loaded
10-
raise Thor::Error.new("please insure the yarn command is available") if `command -v yarn`.blank?
10+
begin
11+
yarn_version = `yarn --version`
12+
raise Errno::ENOENT if yarn_version.blank?
13+
rescue Errno::ENOENT
14+
raise Thor::Error.new("please insure the yarn command is available if using webpacker")
15+
end
1116
end
1217

1318
def add_to_manifests

lib/generators/hyperloop/install_generator.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ class InstallGenerator < Rails::Generators::Base
88

99
def insure_yarn_loaded
1010
return if skip_webpack?
11-
raise Thor::Error.new("please insure the yarn command is available if using webpacker") if `command -v yarn`.blank?
11+
begin
12+
yarn_version = `yarn --version`
13+
raise Errno::ENOENT if yarn_version.blank?
14+
rescue Errno::ENOENT
15+
raise Thor::Error.new("please insure the yarn command is available if using webpacker")
16+
end
1217
end
1318

1419
def inject_react_file_js

lib/generators/hyperloop/install_mui_generator.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ class InstallMuiGenerator < Rails::Generators::Base
77
class_option 'no-build', type: :boolean
88

99
def insure_yarn_loaded
10-
raise Thor::Error.new("please insure the yarn command is available") if `command -v yarn`.blank?
10+
begin
11+
yarn_version = `yarn --version`
12+
raise Errno::ENOENT if yarn_version.blank?
13+
rescue Errno::ENOENT
14+
raise Thor::Error.new("please insure the yarn command is available if using webpacker")
15+
end
1116
end
1217

1318
def add_to_manifests

0 commit comments

Comments
 (0)