MCPcopy Create free account
hub / github.com/cursorless-dev/cursorless / moveFile

Function moveFile

src/scripts/transformRecordedTests/moveFile.ts:11–27  ·  view source on GitHub ↗
(file: string)

Source from the content-addressed store, hash-verified

9 * @param file The file to move
10 */
11export default async function moveFile(file: string) {
12 const buffer = await fsp.readFile(file);
13 const inputFixture = yaml.load(buffer.toString()) as TestCaseFixture;
14 const parent = path.dirname(file);
15 if (path.basename(parent) !== "surroundingPair") {
16 return;
17 }
18 const childDirName =
19 inputFixture.languageId === "plaintext"
20 ? "textual"
21 : `parseTree/${inputFixture.languageId}`;
22 const childDir = path.join(parent, childDirName);
23 await mkdir(childDir, { recursive: true });
24 const outputPath = path.join(childDir, path.basename(file));
25 // console.log(`${file} => ${outputPath}`);
26 await rename(file, outputPath);
27}

Callers

nothing calls this directly

Calls 1

toStringMethod · 0.80

Tested by

no test coverage detected