MCPcopy Create free account
hub / github.com/chubin/cheat.sh / fetch_command

Method fetch_command

lib/adapter/git_adapter.py:65–86  ·  view source on GitHub ↗

Initial fetch of the repository. Return cmdline that has to be executed to fetch the repository. Skipping if `self._repository_url` is not specified

(cls)

Source from the content-addressed store, hash-verified

63
64 @classmethod
65 def fetch_command(cls):
66 """
67 Initial fetch of the repository.
68 Return cmdline that has to be executed to fetch the repository.
69 Skipping if `self._repository_url` is not specified
70 """
71
72 if not cls._repository_url:
73 return None
74
75 if not cls._repository_url.startswith("https://github.com/"):
76 # in this case `fetch` has to be implemented
77 # in the distinct adapter subclass
78 raise RuntimeError(
79 "Do not known how to handle this repository: %s" % cls._repository_url
80 )
81
82 local_repository_dir = cls.local_repository_location()
83 if not local_repository_dir:
84 return None
85
86 return ["git", "clone", "--depth=1", cls._repository_url, local_repository_dir]
87
88 @classmethod
89 def update_command(cls):

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected