diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-08-08 15:13:13 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-08-08 15:13:13 +0100 |
commit | 9f62a26384232890d8dcdc56cd5983b793db3be1 (patch) | |
tree | 515d1a889fc47fa952dfc34e268fa591e76212d1 /lib/tasks/submodules.rake | |
parent | 7caa577e504fb3212c833eb23dc0f1ed6dae464c (diff) |
Only check commonlib, don't try to split the response into segments (as @mhl points out, the case where the initial character is a space is somewhat confusing), just grab the first character of the whole string and check it against expected values.
Diffstat (limited to 'lib/tasks/submodules.rake')
-rw-r--r-- | lib/tasks/submodules.rake | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/tasks/submodules.rake b/lib/tasks/submodules.rake index 1112e443e..426192713 100644 --- a/lib/tasks/submodules.rake +++ b/lib/tasks/submodules.rake @@ -3,24 +3,25 @@ namespace :submodules do desc "Check the status of the project's submodules" task :check => :environment do - commit_info = `git submodule status` - sha, repo, branch = commit_info.split(' ') - case sha[0,1] + commit_info = `git submodule status commonlib` + case commit_info[0,1] when '+' - $stderr.puts "Error: Currently checked out submodule commit for #{repo}" + $stderr.puts "Error: Currently checked out submodule commit for commonlib" $stderr.puts "does not match the commit expected by this version of Alaveteli." $stderr.puts "You can update it with 'git submodule update'." exit(1) when '-' - $stderr.puts "Error: Submodule #{repo} needs to be initialized." + $stderr.puts "Error: Submodule commonlib needs to be initialized." $stderr.puts "You can do this by running 'git submodule update --init'." exit(1) when 'U' - $stderr.puts "Error: Submodule #{repo} has merge conflicts." + $stderr.puts "Error: Submodule commonlib has merge conflicts." $stderr.puts "You'll need to resolve these to run Alaveteli." exit(1) - else + when ' ' exit(0) + else + raise "Unexpected status character in response to 'git submodule status commonlib': #{commit_info[0,1]}" end end |