mirror of
https://github.com/changesets/action
synced 2026-10-26 16:39:56 +08:00
Removed fs-extra dependency (#481)
* Removed `fs-extra` dependency * use `fs/promises` consistently
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import unified from "unified";
|
||||
import remarkParse from "remark-parse";
|
||||
import remarkStringify from "remark-stringify";
|
||||
import fs from "node:fs/promises";
|
||||
import type { Root } from "mdast";
|
||||
// @ts-ignore
|
||||
import mdastToString from "mdast-util-to-string";
|
||||
@@ -105,3 +106,10 @@ export function isErrorWithCode(err: unknown, code: string) {
|
||||
err.code === code
|
||||
);
|
||||
}
|
||||
|
||||
export function fileExists(filePath: string) {
|
||||
return fs.access(filePath, fs.constants.F_OK).then(
|
||||
() => true,
|
||||
() => false
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user