mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-17 03:06:27 -07:00
Use async fileExists
This commit is contained in:
parent
99160eadb3
commit
28192d7723
5 changed files with 21 additions and 15 deletions
|
|
@ -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];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue