-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpull.py
More file actions
28 lines (23 loc) · 1.07 KB
/
pull.py
File metadata and controls
28 lines (23 loc) · 1.07 KB
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
from configuration import *
def pull():
for project, folder, configuration in projects():
if not os.path.exists(folder):
worked('git', 'clone', configuration['source'], folder)
if configuration.get('gitflow', True) and not is_windows():
git(folder, 'flow', 'init', '-d')
else:
if configuration.get('gitflow', True) and not is_windows():
git(folder, 'checkout', 'develop')
else:
git(folder, 'checkout', 'master')
git(folder, 'pull')
git(folder, 'remote', 'prune', 'origin')
git(folder, 'submodule', 'init')
if not is_windows():
git(folder, 'submodule', 'foreach',
"\"(git branch -a | grep 'remotes/origin/develop$') && git flow init -d || true\"")
git(folder, 'submodule', 'sync', '--recursive')
git(folder, 'submodule', 'update', '--init', '--recursive')
if configuration.has_key('post-clone'):
worked('cd', folder, '&&', *configuration['post-clone'])
ACTIONS.append(pull)