MCPcopy Create free account
hub / github.com/Autodesk/Aurora / GitCloneSHA

Function GitCloneSHA

Scripts/installExternalsFunctions.py:611–625  ·  view source on GitHub ↗
(url, sha, cloneDir, context)

Source from the content-addressed store, hash-verified

609 url=url, tag=tag, err=e))
610
611def GitCloneSHA(url, sha, cloneDir, context):
612 try:
613 with CurrentWorkingDirectory(context.externalsSrcDir):
614 # TODO check if cloneDir is a cloned folder of url
615 if not os.path.exists(cloneDir):
616 Run("git clone --recurse-submodules {url} {folder}".format(url=url, folder=cloneDir))
617 with CurrentWorkingDirectory(os.path.join(context.externalsSrcDir, cloneDir)):
618 Run("git checkout {sha}".format(sha=sha))
619 elif not IsGitFolder(cloneDir):
620 raise RuntimeError("Failed to clone repo {url} ({tag}): non-git folder {folder} exists".format(
621 url=url, tag=tag, folder=cloneDir))
622 return os.path.abspath(cloneDir)
623 except Exception as e:
624 raise RuntimeError("Failed to clone repo {url} ({tag}): {err}".format(
625 url=url, tag=tag, err=e))
626
627def WriteExternalsConfig(context, externals):
628 win32Header = """

Callers 1

InstallSTBFunction · 0.85

Calls 4

CurrentWorkingDirectoryFunction · 0.85
RunFunction · 0.85
IsGitFolderFunction · 0.85
formatMethod · 0.80

Tested by

no test coverage detected