Files
edx-platform/rakelib/workspace.rake
Xavier Antoviaque 2a656d0a9b vagrant: Windows - Exclude README from ws_migration
Windows doesn't differentiate between files with/without executable bit,
so this can't be used to exclude the README file from the migrations to
be executed, when the sources are accessed from a Windows partition.
2013-07-10 09:26:43 -04:00

18 lines
667 B
Ruby

MIGRATION_MARKER_DIR = File.join(REPO_ROOT, '.ws_migrations_complete')
SKIP_MIGRATIONS = ENV['SKIP_WS_MIGRATIONS'] || false
directory MIGRATION_MARKER_DIR
namespace :ws do
task :migrate => MIGRATION_MARKER_DIR do
Dir['ws_migrations/*'].select{|m| File.executable?(m)}.each do |migration|
completion_file = File.join(MIGRATION_MARKER_DIR, File.basename(migration))
is_excluded = File.basename(migration).start_with?("README")
if ! File.exist?(completion_file) && ! is_excluded
sh(migration)
File.write(completion_file, "")
end
end unless SKIP_MIGRATIONS
end
end