UNPKG

@platformos/pos-cli

Version:
15 lines (11 loc) 354 B
import logger from '../logger.js'; import shell from 'shelljs'; const noop = () => {}; const directoryEmpty = ({ path, message = 'Directory is empty.', fail = noop }) => { const directoryEmpty = shell.ls(path).length == 0; if (directoryEmpty) { fail(); logger.Error(message, { hideTimestamp: true }); } }; export default directoryEmpty;