Index: tools/cr/cr/commands/sync.py |
diff --git a/tools/cr/cr/commands/sync.py b/tools/cr/cr/commands/sync.py |
index cef9b7a6f4abb9077d28388cf31a707bc69e6399..4f5232ab46f49add0c474e887f7840bab6f92c75 100644 |
--- a/tools/cr/cr/commands/sync.py |
+++ b/tools/cr/cr/commands/sync.py |
@@ -44,12 +44,10 @@ class SyncCommand(cr.Command): |
cr.Host.Execute(context, '{GCLIENT_BINARY}', 'sync', *context.remains) |
-def _AutoDetectGClient(): |
- """Attempts to detect gclient and it's parent repository.""" |
- gclient_binaries = cr.Host.SearchPath('gclient') |
- if gclient_binaries: |
- SyncCommand.DETECTED.Set(GCLIENT_BINARY=gclient_binaries[0]) |
- SyncCommand.DETECTED.Set(DEPOT_TOOLS=os.path.dirname(gclient_binaries[0])) |
- |
-# Invoke the auto detection |
-_AutoDetectGClient() |
+ @classmethod |
+ def ClassInit(cls): |
+ # Attempt to detect gclient and it's parent repository. |
+ gclient_binaries = cr.Host.SearchPath('gclient') |
+ if gclient_binaries: |
+ cls.DETECTED.Set(GCLIENT_BINARY=gclient_binaries[0]) |
+ cls.DETECTED.Set(DEPOT_TOOLS=os.path.dirname(gclient_binaries[0])) |