This repository was archived by the owner on Oct 19, 2018. It is now read-only.
File tree 3 files changed +18
-3
lines changed
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
7
7
class_option 'no-build' , type : :boolean
8
8
9
9
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
11
16
end
12
17
13
18
def add_to_manifests
Original file line number Diff line number Diff line change @@ -8,7 +8,12 @@ class InstallGenerator < Rails::Generators::Base
8
8
9
9
def insure_yarn_loaded
10
10
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
12
17
end
13
18
14
19
def inject_react_file_js
Original file line number Diff line number Diff line change @@ -7,7 +7,12 @@ class InstallMuiGenerator < Rails::Generators::Base
7
7
class_option 'no-build' , type : :boolean
8
8
9
9
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
11
16
end
12
17
13
18
def add_to_manifests
You can’t perform that action at this time.
0 commit comments