class Raykit::SourceImport

def update

def update
  work = self["remote"].work_dir
  work_parent = File.dirname(work)
  FileUtils.mkdir_p(work_parent) unless Dir.exist?(work_parent)
  if Dir.exist?(work)
    Dir.chdir(work) do
      cmd = Command.new("git pull")
    end
  else
    PROJECT.run("git clone #{remote} #{work}")
  end
  Dir.chdir(work) do
    text = `git log -n 1`
    scan = text.scan(/commit (\w+)\s/)
    self["commit"] = scan[0][0].to_s
  end
end