Skip to content

Commit 4caebf5

Browse files
authored
Clear directories when constructing dist (#2205)
Fixes #2198 ## Checklist - [-] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [-] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet) - [-] I have not broken the cheatsheet
1 parent fa66379 commit 4caebf5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/cursorless-vscode/src/scripts/populateDist/populateDist.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copies files into `dist` directory for packaging
22
import { copy, exists } from "fs-extra";
3-
import { lstat, mkdir, readFile, writeFile } from "fs/promises";
3+
import { lstat, mkdir, readFile, rm, writeFile } from "fs/promises";
44
import * as path from "path";
55
import { assets } from "./assets";
66
import { Context } from "./context";
@@ -75,6 +75,7 @@ export async function run() {
7575
console.log(`Copying ${fullSource} to ${fullDestination}`);
7676
// If directory, copy recursively
7777
if ((await lstat(fullSource)).isDirectory()) {
78+
await rm(fullDestination, { recursive: true, force: true });
7879
await mkdir(fullDestination, { recursive: true });
7980
}
8081
await copy(fullSource, fullDestination);

0 commit comments

Comments
 (0)