UNPKG

@platformos/pos-cli

Version:

Manage your platformOS application

13 lines (10 loc) 323 B
const logger = require('../logger'); const shell = require('shelljs'); const noop = () => {}; module.exports = ({ path, message = 'Directory is empty.', fail = noop }) => { const directoryEmpty = shell.ls(path).length == 0; if (directoryEmpty) { fail(); logger.Error(message, { hideTimestamp: true }); } };