Try to make sure submodules get checked out before packaging.

This can't happen if Haml is being packaged from e.g. a GitHub tarball,
which isn't a git repo but also doesn't include submodules.
In these cases, a runtime error will be generated for --watch,
which will instruct the user to install FSSM as a gem.
This commit is contained in:
Nathan Weizenbaum 2010-01-16 15:57:12 -08:00
parent 899285eaea
commit 6248ca3721
1 changed files with 13 additions and 0 deletions

View File

@ -57,6 +57,7 @@ task :revision_file do
end
end
Rake::Task[:package].prerequisites.insert(0, :revision_file)
Rake::Task[:package].prerequisites.insert(0, :submodules)
# We also need to get rid of this file after packaging.
at_exit { File.delete('REVISION') rescue nil }
@ -167,6 +168,18 @@ def mode_unchanged?(mode, version)
return false
end
task :submodules do
if File.exist?(File.dirname(__FILE__) + "/.git")
sh %{git submodule sync}
sh %{git submodule update --init}
elsif !File.exist?(File.dirname(__FILE__) + "/vendor/fssm/lib")
warn <<WARN
WARNING: vendor/fssm doesn't exist, and this isn't a git repository so
I can't get it automatically!
WARN
end
end
task :release_edge do
ensure_git_cleanup do
puts "#{'=' * 50} Running rake release_edge"