From 709bdd78882bcc44692065f8abb9e778712e8035 Mon Sep 17 00:00:00 2001 From: SamTV12345 <40429738+samtv12345@users.noreply.github.com> Date: Sun, 17 Mar 2024 12:03:36 +0100 Subject: [PATCH] Fixed make docs script --- make_docs.js | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/make_docs.js b/make_docs.js index 1a070fe41..19d03226b 100644 --- a/make_docs.js +++ b/make_docs.js @@ -1,9 +1,8 @@ -const { exec } = require('child_process'); -const fs = require('fs') -const path = require('path') +import exec from 'child_process' +import fs from 'fs' +import path from 'path' - -const pjson = require('./src/package.json') +import pjson from './src/package.json' const VERSION=pjson.version console.log(`Building docs for version ${VERSION}`) @@ -15,15 +14,15 @@ const createDirIfNotExists = (dir) => { function copyFolderSync(from, to) { - if(fs.existsSync(to)){ - const stat = fs.lstatSync(to) - if (stat.isDirectory()){ - fs.rmSync(to, { recursive: true }) - } - else{ - fs.rmSync(to) - } - } + if(fs.existsSync(to)){ + const stat = fs.lstatSync(to) + if (stat.isDirectory()){ + fs.rmSync(to, { recursive: true }) + } + else{ + fs.rmSync(to) + } + } fs.mkdirSync(to); fs.readdirSync(from).forEach(element => { if (fs.lstatSync(path.join(from, element)).isFile()) {