This repository was archived by the owner on Jan 15, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,9 @@ def run!
6565 end
6666
6767 # Move the logfile back over
68- FileUtils . mv ( Strainer . logfile_path , Strainer . sandbox_path . join ( 'strainer.out' ) )
68+ if File . exist? ( Strainer . sandbox_path . join ( 'strainer.out' ) )
69+ FileUtils . mv ( Strainer . logfile_path , Strainer . sandbox_path . join ( 'strainer.out' ) )
70+ end
6971
7072 if @report . values . collect ( &:values ) . flatten . all?
7173 Strainer . ui . say "Strainer marked build OK"
Original file line number Diff line number Diff line change @@ -37,8 +37,15 @@ def initialize(cookbook_names, options = {})
3737 @options = options
3838
3939 if chef_repo?
40- @cookbooks = load_cookbooks ( cookbook_names )
40+ Strainer . ui . debug "Detected as a chef repo"
41+ if cookbook_names . empty?
42+ Strainer . ui . fatal "You must specify one or more cookbook names to `strainer test`!"
43+ exit ( false )
44+ else
45+ @cookbooks = load_cookbooks ( cookbook_names )
46+ end
4147 elsif cookbook_repo?
48+ Strainer . ui . debug "Detected as a cookbook repo"
4249 unless cookbook_names . empty?
4350 Strainer . ui . warn "Supply specific cookbooks to a cookbook_repo is not supported. Use `strainer test` with no arguments instead."
4451 end
You can’t perform that action at this time.
0 commit comments