Skip to content

Commit 21de568

Browse files
fix: made removing setup scripts safer (#506)
## PR Checklist - [x] Addresses an existing open issue: fixes #501 - [x] That issue was marked as [`status: accepting prs`](https://github.com/JoshuaKGoldberg/template-typescript-node-package/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22) - [x] Steps in [CONTRIBUTING.md](https://github.com/JoshuaKGoldberg/template-typescript-node-package/blob/main/.github/CONTRIBUTING.md) were taken ## Overview Uses `force: true, recursive: true` on all the paths.
1 parent e3c97ee commit 21de568

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed
Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
import fs from "node:fs/promises";
22

3+
const globPaths = [
4+
"./script",
5+
"./src/hydrate",
6+
"./src/setup",
7+
"./src/shared",
8+
".github/workflows/hydrate.yml",
9+
".github/workflows/setup.yml",
10+
];
11+
312
export async function removeSetupScripts() {
4-
await fs.rm("./script", { force: true, recursive: true });
5-
await fs.rm("./src/hydrate", { force: true, recursive: true });
6-
await fs.rm("./src/setup", { force: true, recursive: true });
7-
await fs.rm("./src/shared", { force: true, recursive: true });
8-
await fs.rm(".github/workflows/hydrate.yml");
9-
await fs.rm(".github/workflows/setup.yml");
13+
for (const globPath of globPaths) {
14+
await fs.rm(globPath, { force: true, recursive: true });
15+
}
1016
}

0 commit comments

Comments
 (0)