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

Function prepareDirPath

packages/cli/src/utils/utils.ts:116–125  ·  view source on GitHub ↗
(path: string, recreate: boolean)

Source from the content-addressed store, hash-verified

114}
115
116export async function prepareDirPath(path: string, recreate: boolean): Promise<void> {
117 try {
118 await rimraf(path);
119 if (recreate) {
120 await fs.promises.mkdir(path, {recursive: true});
121 }
122 } catch (e: any) {
123 throw new Error(`Failed to prepare ${path}: ${e.message}`);
124 }
125}
126
127// oclif's default path resolver only applies when parsed as `--flag path`
128// else it would not resolve, hence we need to resolve it manually.

Callers 4

codegenFunction · 0.90
generateSchemaModelsFunction · 0.90
prepareProjectScaffoldFunction · 0.90
migrateManifestFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected