import * as path from 'path' import * as fs from 'fs-extra-promise' import * as del from 'del' import * as Promise from 'bluebird' export function copy (src: string, dest: string): Promise { return fs.copyAsync(src, dest, { clobber: true }) } export function remove (entities: string | string[]): Promise { return Promise.resolve(del(entities, { force: true })) .then((): void => {}) } export function removeExtension (filePath: string): string { var file = path.parse(filePath) return path.join(file.dir, file.name) } export function isEmptyDirectory (dir: string): Promise { return fs.readdirAsync(dir) .then((files: string[]): boolean => !files.length) }