Added uploaddata API for dataEditor module

This commit is contained in:
MrFry 2020-03-25 16:39:55 +01:00
parent 105d1ee8be
commit 890998bce5
3 changed files with 80 additions and 5 deletions

View file

@ -8,7 +8,8 @@ module.exports = {
FileExists: FileExists,
CreatePath: CreatePath,
WatchFile: WatchFile,
ReadDir: ReadDir
ReadDir: ReadDir,
CopyFile: CopyFile
}
var fs = require('fs')
@ -17,6 +18,11 @@ var logger = require('../utils/logger.js')
const dataFile = './public/data.json'
function CopyFile (from, to) {
CreatePath(to)
fs.copyFileSync(from, to)
}
function ReadDir (path) {
return fs.readdirSync(path)
}