-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathupdate-all.sh
executable file
·33 lines (29 loc) · 952 Bytes
/
update-all.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh
# http://stackoverflow.com/a/19029685
oldPWD=$(pwd)
cd formulas/saltstack-formulas
curl -s https://api.github.com/orgs/saltstack-formulas/repos?per_page=200 | ruby -rubygems -e '
require "json";
JSON.load(STDIN.read).each {
|repo|
if !File.directory?(repo["name"])
print "git submodule add #{repo["clone_url"]} #{repo["name"]} "
%x[ git submodule add #{repo["clone_url"]} #{repo["name"]} ]
end
}
'
cd $oldPWD
cd formulas/bechtoldt
curl -s https://api.github.com/orgs/bechtoldt/repos?per_page=200 | ruby -rubygems -e '
require "json";
JSON.load(STDIN.read).each {
|repo|
if !File.directory?(repo["name"])
print "git submodule add #{repo["clone_url"]} #{repo["name"]} "
%x[ git submodule add #{repo["clone_url"]} #{repo["name"]} ]
end
}
'
# git submodule update --init --recursive
git submodule foreach --recursive git fetch
git submodule foreach git pull --ff-only origin master