Changed path import

This commit is contained in:
Maks 2018-08-21 09:57:09 +02:00 committed by GitHub
parent e78021a538
commit 7c44b92bce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -11,7 +11,7 @@
import fs from 'fs';
import _ from 'lodash';
import filetype from 'file-type';
import { join as pathJoin } from 'path';
import join from 'path';
export class Utils {
static overload(fn, cb) {
@ -500,13 +500,13 @@ export class FileUtils {
* @param {String} path The directory's path
* @return {Promise}
*/
static async deleteDirectory(path) {
static async deleteDirectory(pathToDir) {
try {
await this.directoryExists(path);
const files = await this.listDirectory(path);
await this.directoryExists(pathToDir);
const files = await this.listDirectory(pathToDir);
for (const file of files) {
const pathToFile = pathJoin(path, file);
const pathToFile = path.join(pathToDir, file);
try {
await this.directoryExists(pathToFile);
await this.deleteDirectory(pathToFile);