Sha256: 50ee0923488a3048463a7f92d87805df6981802dafb97199ab58c478b138c17d

Contents?: true

Size: 1.46 KB

Versions: 6

Compression:

Stored size: 1.46 KB

Contents

#!/usr/bin/env ruby
require 'fileutils'
REFINERY_ROOT = File.expand_path(File.dirname(__FILE__) << "/..")
RAILS_ROOT = ARGV.first unless defined? RAILS_ROOT
unless RAILS_ROOT.nil? or RAILS_ROOT.length == 0
  # ensure asset directories exist.
  dirs = [%w(public stylesheets), %w(public javascripts), %w(db migrate), %w(lib tasks)]
  FileUtils::makedirs dirs.map {|dir| File.join(RAILS_ROOT, dir) }
  
  # copy in the new assets.
  assets = [%w(public stylesheets refinery), %w(public javascripts refinery)]
	assets.each do |asset|
	  FileUtils::rm_rf File.join(RAILS_ROOT, asset), :secure => true # ensure the destination is clear.
	  FileUtils::cp_r File.join(REFINERY_ROOT, asset), File.join(RAILS_ROOT, asset) # copy the new assets into the project.
  end
  
  # copy in any new migrations.
  FileUtils::cp Dir[File.join(REFINERY_ROOT, %w(db migrate *.rb))], File.join(RAILS_ROOT, %w(db migrate))
  
  # copy any rake tasks from plugins to the main lib directory so they can be run.
  FileUtils::cp Dir[File.join(REFINERY_ROOT, %w(** tasks *.rake))], File.join(RAILS_ROOT, %w(lib tasks))
	
	unless ARGV.include?("--from-refinery-installer")
	  puts "---------"
	  puts "Copied new Refinery core assets."
	  puts "Please run rake db:migrate to ensure your database is at the correct version."
  end
else
  unless ARGV.include?("--from-refinery-installer")
    puts "Please specify the path of the refinery project that you want to update, i.e. refinery-update-core /path/to/project"
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
refinerycms-0.9.5.9 bin/refinery-update-core
refinerycms-0.9.5.8 bin/refinery-update-core
refinerycms-0.9.5.7 bin/refinery-update-core
refinerycms-0.9.5.6 bin/refinery-update-core
refinerycms-0.9.5.5 bin/refinery-update-core
refinerycms-0.9.5.4 bin/refinery-update-core