MCPcopy
hub / github.com/subquery/subql / installAndBuild

Function installAndBuild

packages/cli/src/createProject.fixtures.ts:71–83  ·  view source on GitHub ↗
(projectDir: string)

Source from the content-addressed store, hash-verified

69}
70
71async function installAndBuild(projectDir: string): Promise<void> {
72 // Install dependencies
73 childProcess.execSync(`npm i`, {cwd: projectDir});
74
75 // NODE_ENV should be "test" we need to create an env file for it
76 const envFile = path.join(projectDir, '.env');
77 if (fs.existsSync(envFile)) {
78 await fs.promises.copyFile(envFile, path.join(projectDir, `.env.${process.env.NODE_ENV}`));
79 }
80
81 await Codegen.run([projectDir]);
82 await Build.run([projectDir]);
83}
84
85export async function createTestProject(): Promise<string> {
86 const tmpdir = await fs.promises.mkdtemp(`${os.tmpdir()}${path.sep}`);

Callers 2

createTestProjectFunction · 0.85

Calls 1

runMethod · 0.45

Tested by

no test coverage detected