svrjs-statistics-server-php/scripts/copyBackend.js

23 lines
617 B
JavaScript
Raw Permalink Normal View History

2024-12-18 18:02:43 +01:00
const fs = require("fs");
const cpr = require("cpr");
const path = require("path");
const srcFolder = path.resolve(__dirname, "..", "src");
const dbFolder = path.resolve(__dirname, "..", "db");
const distFolder = path.resolve(__dirname, "..", "dist");
fs.mkdir(distFolder, (err) => {
if (err && err.code != "EEXIST") throw err;
cpr(srcFolder, distFolder, {
overwrite: true,
filter: (pathname) => pathname != path.resolve(srcFolder, "config.php")
}, (err) => {
if (err) throw err;
cpr(dbFolder, distFolder, {
overwrite: true
}, (err) => {
if (err) throw err;
})
})
});