File tree Expand file tree Collapse file tree 3 files changed +11
-9
lines changed Expand file tree Collapse file tree 3 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -6,10 +6,16 @@ module Commands
66 class Base < MisterBin ::Command
77 include AssetHelper
88
9+ def config
10+ @config ||= Config . new "#{ Settings . source_dir } /bashly.yml"
11+ end
12+
13+ def config_validator
14+ @config_validator ||= ConfigValidator . new config
15+ end
16+
917 def validate_config
10- config = Config . new "#{ Settings . source_dir } /bashly.yml"
11- validator = ConfigValidator . new config
12- validator . validate
18+ config_validator . validate
1319 end
1420 end
1521 end
Original file line number Diff line number Diff line change @@ -128,10 +128,6 @@ def master_script_path
128128 "#{ Settings . target_dir } /#{ command . name } "
129129 end
130130
131- def config
132- @config ||= Config . new "#{ Settings . source_dir } /bashly.yml"
133- end
134-
135131 def command
136132 @command ||= Script ::Command . new config
137133 end
Original file line number Diff line number Diff line change @@ -9,8 +9,8 @@ class Preview < Base
99 environment "BASHLY_SOURCE_DIR" , "The path containing the bashly configuration and source files [default: src]"
1010
1111 def run
12- config = Config . new " #{ Settings . source_dir } /bashly.yml"
13- command = Script ::Command . new ( config )
12+ validate_config
13+ command = Script ::Command . new config
1414 script = Script ::Wrapper . new command
1515 puts script . code
1616 end
You can’t perform that action at this time.
0 commit comments