def load_json(key)
      path = if yaml[key] =~ %r{^/} # root path given
               yaml[key]
             else # relative path
               dirname = File.dirname(options[:config])
               "#{dirname}/#{yaml[key]}"
             end
      if File.exist?(path)
        Mash.from_hash(JSON.parse(IO.read(path)))
      else
        puts "ERROR: #{key}.json config does not exist at: #{path}"
        exit 1
      end
    end
def load_json(key)
      path = if yaml[key] =~ %r{^/} # root path given
               yaml[key]
             else # relative path
               dirname = File.dirname(options[:config])
               "#{dirname}/#{yaml[key]}"
             end
      if File.exist?(path)
        Mash.from_hash(JSON.parse(IO.read(path)))
      else
        puts "ERROR: #{key}.json config does not exist at: #{path}"
        exit 1
      end
    end
the chap.json and node.json is assumed to be in th same folder as
 chap.yml if a relative path is given