Skip to content

Commit

Permalink
Hopefully fixed cli for windows and osx again.
Browse files Browse the repository at this point in the history
  • Loading branch information
balupton committed Feb 25, 2011
1 parent 27972f9 commit 4b0eaab
Showing 1 changed file with 39 additions and 7 deletions.
46 changes: 39 additions & 7 deletions cli
Expand Up @@ -249,6 +249,22 @@ class App
end
end
end

# Apply multiple commands to submodules
def submodule_foreach(command)
# Recursion
if command.kind_of?(Array)
result = ""
command.each do |c|
result = result + submodule_foreach(c,output)
end
return result
end

result = run("git submodule foreach --recursive '" + command + "'")

return result
end

# Check if a Remote Exists
def remote_exists(remote)
Expand Down Expand Up @@ -346,26 +362,42 @@ class App
def init_submodules
run([
"git submodule init",
"git submodule update",
"git submodule foreach --recursive git reset --hard && git branch -D dev && git checkout -b dev origin/dev && git checkout master && git submodule init && git submodule update"
"git submodule update"
])

submodule_foreach([
"git reset --hard",
"git branch -D dev",
"git checkout -b dev origin/dev",
"git checkout master",
"git submodule init",
"git submodule update"
])
end

# Update Submodules
def update_submodules
run([
"git submodule init",
"git submodule update --merge",
"git submodule foreach git submodule init && git submodule update --merge"
"git submodule update --merge"
])

submodule_foreach([
"git submodule init",
"git submodule update --merge"
])
end

# Upgrade Submodules
def upgrade_submodules
run([
"git submodule init",
"git submodule update --merge",
"git submodule foreach git checkout master && git pull --all"
"git submodule update --merge"
])

submodule_foreach([
"git checkout master",
"git pull --all"
])
end

Expand Down Expand Up @@ -401,7 +433,7 @@ class App

# Build Aloha Editor
def build
run(["cd build","ant build","cd .."])
run("ant -f build/build.xml build")
end

# ---------------------------------------------------------------------------
Expand Down

0 comments on commit 4b0eaab

Please sign in to comment.