MCPcopy Index your code
hub / github.com/subquery/subql / cloneProjectGit

Function cloneProjectGit

packages/cli/src/controller/init-controller.ts:101–120  ·  view source on GitHub ↗
(
  localPath: string,
  projectName: string,
  projectRemote: string,
  branch: string
)

Source from the content-addressed store, hash-verified

99}
100
101export async function cloneProjectGit(
102 localPath: string,
103 projectName: string,
104 projectRemote: string,
105 branch: string
106): Promise<string> {
107 const projectPath = path.join(localPath, projectName);
108 try {
109 await git().clone(projectRemote, projectPath, ['-b', branch, '--single-branch']);
110 } catch (e) {
111 let err = 'Failed to clone starter template from git';
112 try {
113 execSync('git --version');
114 } catch (_) {
115 err += ', please install git and ensure that it is available from command line';
116 }
117 throw new Error(err);
118 }
119 return projectPath;
120}
121
122export async function cloneProjectTemplate(
123 localPath: string,

Callers 2

Calls 1

cloneMethod · 0.80

Tested by

no test coverage detected