mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-31 19:02:59 +01:00
Fixed make docs script
This commit is contained in:
parent
3acce2cb85
commit
709bdd7888
1 changed files with 13 additions and 14 deletions
27
make_docs.js
27
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()) {
|
||||
|
|
Loading…
Reference in a new issue