This repository was archived by the owner on Oct 19, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +18
-3
lines changed
Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments