aboutsummaryrefslogtreecommitdiff
path: root/lib/leap_cli/commands/deploy.rb
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2013-02-21 17:15:39 -0500
committerMicah Anderson <micah@riseup.net>2013-02-21 17:15:39 -0500
commit2e8e103f42a81c39058feace314a78667f8b316f (patch)
tree9343c6fcff96915b6b390b2fbaf2e4fe05f2e566 /lib/leap_cli/commands/deploy.rb
parentef718864cabfa95d4fbed037022f6688d86f87b1 (diff)
downloadleap_cli-2e8e103f42a81c39058feace314a78667f8b316f.tar.gz
leap_cli-2e8e103f42a81c39058feace314a78667f8b316f.tar.bz2
handle submodule updates and url changes
If a submodule had an update, it would show up as a + in the 'git submodule status' output, and thus would not be automatically updated because we were only looking for '-', so the regexp was changed to look for + as well as - Additionally, add a 'git submodule sync' on every run in order to capture the case where an upstream submodule URL was changed. This doesn't happen often, but it can be quite painful when it does, and fortunately 'git submodule sync' is a local (and thus, cheap) command.
Diffstat (limited to 'lib/leap_cli/commands/deploy.rb')
-rw-r--r--lib/leap_cli/commands/deploy.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/leap_cli/commands/deploy.rb b/lib/leap_cli/commands/deploy.rb
index 115f06c..b5595f0 100644
--- a/lib/leap_cli/commands/deploy.rb
+++ b/lib/leap_cli/commands/deploy.rb
@@ -96,9 +96,10 @@ module LeapCli
def init_submodules
Dir.chdir Path.platform do
+ assert_run! "git submodule sync"
statuses = assert_run! "git submodule status"
statuses.strip.split("\n").each do |status_line|
- if status_line =~ /^-/
+ if status_line =~ /^[\+-]/
submodule = status_line.split(' ')[1]
log "Updating submodule #{submodule}"
assert_run! "git submodule update --init #{submodule}"