sharyn
Version:
Combines all the other packages under one.
17 lines (13 loc) • 298 B
Flow
// @flow
import fs from 'fs'
import appRoot from './app-root'
const hasFile = (path: string, isRequired?: boolean) => {
if (fs.existsSync(`${appRoot}/${path}`)) {
return true
}
if (isRequired) {
throw Error(`File ${path} is required`)
}
return false
}
module.exports = hasFile