Skip to content

Commit 5ec4edf

Browse files
committed
Change the synch.py script to make it usable as a module
1 parent 12d085e commit 5ec4edf

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

workspace_tools/synch.py

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,24 @@ def visit_repo(repo_file):
283283
def update_mbed():
284284
update_repo("mbed", join(BUILD_DIR, "mbed"))
285285

286+
def do_sync(options):
287+
global push_remote, quiet, commit_msg
288+
289+
push_remote = not options.nopush
290+
quiet = options.quiet
291+
commit_msg = options.msg
292+
293+
if options.code:
294+
update_code(OFFICIAL_CODE)
295+
296+
if options.dependencies:
297+
update_dependencies(CODE_WITH_DEPENDENCIES)
298+
299+
if options.mbed:
300+
update_mbed()
301+
302+
if changed:
303+
print "Repositories with changes:", changed
286304

287305
if __name__ == '__main__':
288306
parser = OptionParser()
@@ -312,19 +330,5 @@ def update_mbed():
312330

313331
(options, args) = parser.parse_args()
314332

315-
push_remote = not options.nopush
316-
quiet = options.quiet
317-
commit_msg = options.msg
318-
319-
if options.code:
320-
update_code(OFFICIAL_CODE)
321-
322-
if options.dependencies:
323-
update_dependencies(CODE_WITH_DEPENDENCIES)
324-
325-
if options.mbed:
326-
update_mbed()
327-
328-
if changed:
329-
print "Repositories with changes:", changed
333+
do_sync(options)
330334

0 commit comments

Comments
 (0)