Skip to content

Commit

Permalink
fix: use fs instead of rimraf
Browse files Browse the repository at this point in the history
it wasn't waiting anymore!
  • Loading branch information
pi0 committed Jan 13, 2023
1 parent aa147bc commit bbd374d
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 13 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
"pathe": "^1.0.0",
"pkg-types": "^1.0.1",
"pretty-bytes": "^6.0.0",
"rimraf": "^4.0.4",
"rollup": "^3.10.0",
"rollup-plugin-dts": "^5.1.1",
"scule": "^1.0.0",
Expand Down
8 changes: 0 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { promisify } from "node:util";
import { readdirSync, statSync } from "node:fs";
import { dirname, resolve } from "pathe";
import mkdirp from "mkdirp";
import _rimraf from "rimraf";
import jiti from "jiti";
import consola from "consola";
import type { PackageJson } from "pkg-types";
Expand Down Expand Up @@ -45,11 +44,9 @@ export function getpkg(id = "") {
return s[0][0] === "@" ? `${s[0]}/${s[1]}` : s[0];
}

const rimraf = promisify(_rimraf);

export async function rmdir(dir: string) {
await fsp.unlink(dir).catch(() => {});
await rimraf(dir, {});
await fsp.rm(dir, { recursive: true, force: true }).catch(() => {});
}

export function listRecursively(path: string) {
Expand Down

0 comments on commit bbd374d

Please sign in to comment.