fix: rebuild errors on windows ()

This commit is contained in:
kabirgh 2024-01-15 16:39:16 +00:00 committed by GitHub
parent f36376503a
commit 8eec47c340
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 27 additions and 5 deletions
quartz/util

13
quartz/util/fs.ts Normal file
View file

@ -0,0 +1,13 @@
import os from "os"
import { rimraf, RimrafAsyncOptions } from "rimraf"
export async function rmrf(
path: string | string[],
opt?: RimrafAsyncOptions | undefined,
): Promise<boolean> {
if (os.platform() == "win32") {
return rimraf.windows(path, opt)
} else {
return rimraf(path, opt)
}
}