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; }) }) });