def fetch_guardfile_contents
if options[:guardfile_contents]
::Guard::UI.info 'Using inline Guardfile.'
options[:guardfile_path] = 'Inline Guardfile'
elsif options[:guardfile]
if File.exist?(options[:guardfile])
read_guardfile(options[:guardfile])
::Guard::UI.info "Using Guardfile at #{ options[:guardfile] }."
else
::Guard::UI.error "No Guardfile exists at #{ options[:guardfile] }."
exit 1
end
else
if File.exist?(guardfile_default_path)
read_guardfile(guardfile_default_path)
else
::Guard::UI.error 'No Guardfile found, please create one with `guard init`.'
exit 1
end
end
unless guardfile_contents_usable?
::Guard::UI.error 'No Guard plugins found in Guardfile, please add at least one.'
end
end