#!/usr/bin/env ruby
#
# Synchronize Satellite with the master repository
#

$LOAD_PATH.unshift(File.join(File.expand_path(File.dirname(__FILE__)), '../lib'))

require 'db'

# use production configuration
CONF = Configuration.load(:production)

# sync to master repository
begin
  Db.sync
rescue Db::MergeConflict => e
  puts "Error: Encountered conflicts during sync. The following files must be merged manually:"
  puts Db.conflicts.collect {|c| "  * #{c}" }.join("\n")
  exit 1
end
