UNPKG

@platformos/pos-cli

Version:

Manage your platformOS application

13 lines (10 loc) 316 B
const logger = require('../logger'); const fs = require('fs'); const noop = () => {}; module.exports = ({ path, message = "Directory doesn't exist.", fail = noop }) => { const directoryExists = fs.existsSync(path); if (!directoryExists) { fail(); logger.Error(message, { hideTimestamp: true }); } };