From d246c28f70f5cd2ac40110b2d376ad0bac59384d Mon Sep 17 00:00:00 2001 From: Matt Carvin <90224411+mcarvin8@users.noreply.github.com> Date: Sat, 27 Jul 2024 21:47:50 -0400 Subject: [PATCH] fix: refactor fs import --- src/helpers/getRepoRoot.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/helpers/getRepoRoot.ts b/src/helpers/getRepoRoot.ts index 8d5ad2f..d09daee 100644 --- a/src/helpers/getRepoRoot.ts +++ b/src/helpers/getRepoRoot.ts @@ -1,10 +1,11 @@ 'use strict'; -import * as fs from 'node:fs'; +import { promises as fsPromises, readFile, stat, readdir } from 'node:fs'; import git from 'isomorphic-git'; export async function getRepoRoot(): Promise { + const fs = { promises: fsPromises, readFile, stat, readdir }; const repoRoot = await git.findRoot({ - fs: { ...fs, promises: fs.promises }, + fs, filepath: process.cwd(), }); return repoRoot;