Files
pnpm/exec/plugin-commands-script-runners/src/existsInDir.ts
2024-07-08 17:51:23 +02:00

9 lines
249 B
TypeScript

import fs from 'fs'
import path from 'path'
export function existsInDir (entityName: string, dir: string): string | undefined {
const entityPath = path.join(dir, entityName)
if (fs.existsSync(entityPath)) return entityPath
return undefined
}