Use async fileExists

This commit is contained in:
HaveAGitGat 2024-06-01 08:27:41 +01:00
parent 99160eadb3
commit 28192d7723
5 changed files with 21 additions and 15 deletions

View file

@ -1,6 +1,8 @@
import { promises as fsp } from 'fs';
import { IpluginInputArgs } from './interfaces/interfaces';
export const fileExists = async (path:string): Promise<boolean> => !!(await fsp.stat(path).catch(() => false));
export const getContainer = (filePath: string): string => {
const parts = filePath.split('.');
return parts[parts.length - 1];