MCPcopy Create free account
hub / github.com/hey-api/hey-api / renameFile

Function renameFile

packages/openapi-python/src/generate/client.ts:81–98  ·  view source on GitHub ↗
({
  filePath,
  project,
  renamed,
}: {
  filePath: string;
  project: IProject;
  renamed: Map<string, string>;
})

Source from the content-addressed store, hash-verified

79}
80
81function renameFile({
82 filePath,
83 project,
84 renamed,
85}: {
86 filePath: string;
87 project: IProject;
88 renamed: Map<string, string>;
89}): void {
90 const extension = path.extname(filePath);
91 const name = path.basename(filePath, extension);
92 const renamedName = project.fileName?.(name) || name;
93 if (renamedName !== name) {
94 const outputPath = path.dirname(filePath);
95 fs.renameSync(filePath, path.resolve(outputPath, `${renamedName}${extension}`));
96 renamed.set(name, renamedName);
97 }
98}
99
100function replaceImports({
101 filePath,

Callers 1

generateClientBundleFunction · 0.70

Calls 2

resolveMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected