Update utils.js

This commit is contained in:
freearhey 2021-03-13 15:49:04 +03:00
parent 134a727824
commit d39781b3c7
1 changed files with 3 additions and 4 deletions

View File

@ -4,7 +4,6 @@ const axios = require('axios')
const axiosCookieJarSupport = require('axios-cookiejar-support').default
const tough = require('tough-cookie')
const convert = require('xml-js')
const glob = require('glob')
const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc')
dayjs.extend(utc)
@ -128,13 +127,13 @@ utils.getDirectory = function (file) {
}
utils.createDir = function (dir) {
if (!fs.existsSync(path.resolve(__dirname, dir))) {
fs.mkdirSync(path.resolve(__dirname, dir))
if (!fs.existsSync(path.resolve(dir))) {
fs.mkdirSync(path.resolve(dir))
}
}
utils.writeToFile = function (filename, data) {
fs.writeFileSync(path.resolve(__dirname, filename), data)
fs.writeFileSync(path.resolve(filename), data)
}
utils.createHttpClient = function (config) {