diff --git a/scripts/build-corelibs.js b/scripts/build-corelibs.js index 95b6b637..d335ef0f 100644 --- a/scripts/build-corelibs.js +++ b/scripts/build-corelibs.js @@ -4,7 +4,7 @@ import { minify } from 'terser'; import * as scriptletList from '../src/scriptlets/scriptlets-list'; import { version } from '../package.json'; -import { writeFileAsync } from './helpers'; +import { writeFile } from './helpers'; const buildCorelibsJson = async () => { const { getScriptletFunction } = require('../tmp/scriptlets-func'); // eslint-disable-line import/no-unresolved,global-require @@ -37,6 +37,6 @@ const buildCorelibsJson = async () => { export const buildScriptletsForCorelibs = async () => { console.log('Start building corelibs...'); const json = await buildCorelibsJson(); - await writeFileAsync(path.resolve(__dirname, '../dist/scriptlets.corelibs.json'), json, 'utf8'); + await writeFile(path.resolve(__dirname, '../dist/scriptlets.corelibs.json'), json, 'utf8'); console.log('Corelibs built'); }; diff --git a/scripts/build-funcs.js b/scripts/build-funcs.js index 44a8a942..57683c13 100644 --- a/scripts/build-funcs.js +++ b/scripts/build-funcs.js @@ -18,7 +18,7 @@ import path from 'path'; import { minify } from 'terser'; import { addCall, attachDependencies } from '../src/helpers/injector'; -import { writeFileAsync } from './helpers'; +import { writeFile } from './helpers'; /** * Method creates string for file with scriptlets functions, @@ -67,7 +67,7 @@ export const buildScriptletsFunc = async () => { format: { beautify: true }, }); - await writeFileAsync(path.resolve(__dirname, '../tmp/scriptlets-func.js'), beautifiedScriptletFunctions.code); + await writeFile(path.resolve(__dirname, '../tmp/scriptlets-func.js'), beautifiedScriptletFunctions.code); console.log('Scriptlets functions built successfully'); }; diff --git a/scripts/build-redirects-map.js b/scripts/build-redirects-map.js index 52dada05..cea37bf9 100644 --- a/scripts/build-redirects-map.js +++ b/scripts/build-redirects-map.js @@ -3,7 +3,7 @@ import { minify } from 'terser'; import path from 'path'; import { getPreparedRedirects } from './build-redirects'; -import { writeFileAsync } from './helpers'; +import { writeFile } from './helpers'; const createRedirectsMap = (redirects) => { const map = {}; @@ -41,7 +41,7 @@ export const buildRedirectsMap = async () => { format: { beautify: true }, }); - await writeFileAsync(path.resolve(__dirname, '../tmp/redirects-map.js'), beautifiedScriptletFunctions.code); + await writeFile(path.resolve(__dirname, '../tmp/redirects-map.js'), beautifiedScriptletFunctions.code); console.log('Finish building redirect map'); }; diff --git a/scripts/build-txt.js b/scripts/build-txt.js index aa449bb3..8797c944 100644 --- a/scripts/build-txt.js +++ b/scripts/build-txt.js @@ -1,5 +1,5 @@ import path from 'path'; -import { writeFileAsync } from './helpers'; +import { writeFile } from './helpers'; import { version } from '../package.json'; const PATH = '../dist'; @@ -7,5 +7,5 @@ const FILENAME = 'build.txt'; export const buildTxt = async () => { const content = `version=${version}`; - await writeFileAsync(path.resolve(__dirname, PATH, FILENAME), content); + await writeFile(path.resolve(__dirname, PATH, FILENAME), content); }; diff --git a/scripts/helpers.js b/scripts/helpers.js index 068937bf..5c1adbe2 100644 --- a/scripts/helpers.js +++ b/scripts/helpers.js @@ -8,7 +8,7 @@ const dox = require('dox'); * @param {string} filePath absolute path to file * @param {string} content content to write to the file */ -const writeFileAsync = async (filePath, content) => { +const writeFile = async (filePath, content) => { const dirname = path.dirname(filePath); await fs.ensureDir(dirname); @@ -120,7 +120,7 @@ const getDataFromFiles = (filesList, relativeDirPath) => { }; module.exports = { - writeFileAsync, + writeFile, getFilesList, getDataFromFiles, };