-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsync.py
More file actions
22 lines (19 loc) · 742 Bytes
/
sync.py
File metadata and controls
22 lines (19 loc) · 742 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import os
from optparse import OptionParser
from project import Project
class Sync():
def __init__(self):
self.parser = OptionParser()
self.parser.add_option("-b", "--branch", dest="branch", help="with checkout branch")
self.parser.add_option("-C", "--repo-dir", dest="repodir", help="repo directory")
self.parser.add_option("-R", "--recursive", dest="recursive", help="sync project and subproject recursively")
self.parser.set_usage("mgit sync")
def print_usage(self):
self.parser.print_usage()
def run(self, args):
self.options,args = self.parser.parse_args(args)
cwd = os.getcwd()
if self.options.repodir != None:
os.chdir("/".join([cwd, self.options.repodir]))
self.project = Project()
self.project.clone()