📃 changed to access

This commit is contained in:
ful1e5 2020-09-27 11:46:23 +05:30
parent 06ad25e924
commit 4d56930d8e

View file

@ -1,5 +1,5 @@
import { resolve } from "path";
import { exists, mkdirSync, writeFileSync } from "fs";
import { access, mkdirSync, writeFileSync } from "fs";
interface WriteSchemaData {
path: string;
@ -8,8 +8,8 @@ interface WriteSchemaData {
}
const writeSchemaData = ({ path, content, fileName }: WriteSchemaData) => {
exists(path, (exists) => {
if (!exists) {
access(path, (isAccessible) => {
if (!isAccessible) {
mkdirSync(path, { recursive: true });
}
});