From 7c44b92bce227ed6d3813240673ac564252e2aa4 Mon Sep 17 00:00:00 2001 From: Maks <26678512+Maks-s@users.noreply.github.com> Date: Tue, 21 Aug 2018 09:57:09 +0200 Subject: [PATCH] Changed path import --- common/modules/utils.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/common/modules/utils.js b/common/modules/utils.js index a28b49f2..fc714398 100644 --- a/common/modules/utils.js +++ b/common/modules/utils.js @@ -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);