# File lib/chef/knife/exec.rb, line 63 def find_script(x) # Try to find a script. First try expanding the path given. script = File.expand_path(x) return script if File.exists?(script) # Failing that, try searching the script path. If we can't find # anything, fail gracefully. Chef::Log.debug("Searching script_path: #{config[:script_path].inspect}") config[:script_path].each do |path| path = File.expand_path(path) test = File.join(path, x) Chef::Log.debug("Testing: #{test}") if File.exists?(test) script = test Chef::Log.debug("Found: #{test}") return script end end ui.error("\"#{x}\" not found in current directory or script_path, giving up.") exit(1) end