Files
mudita-center/scripts/copy-static-sql-js-dependencies.js
patryk-sierzega c85ceed34c [CP-2260] Setup Nx (#1607)
Co-authored-by: Daniel Karski <daniel.karski5q@gmail.com>
Co-authored-by: Oskar Michalkiewicz <32848134+OskarMichalkiewicz@users.noreply.github.com>
Co-authored-by: Łukasz Kowalczyk <freelancer.lukasz.kowalczyk@gmail.com>
Co-authored-by: Michał Kurczewski <michalkurczewski94@gmail.com>
Co-authored-by: mkurczewski <michal@kurczewski.dev>
2023-12-12 14:40:04 +01:00

29 lines
988 B
JavaScript

const fs = require('fs');
const path = require("path")
const shell = require('child_process').execSync;
const FILES_TO_COPY = ['sql-wasm-debug.js', 'sql-wasm-debug.wasm', 'sql-wasm.js', 'sql-wasm.wasm']
FILES_TO_COPY.forEach(fileName => {
const sourcePath = path.resolve(__dirname, "../node_modules/sql.js/dist", fileName)
const destinationPath = path.resolve(__dirname, "../apps/mudita-center/static", fileName)
console.log("sourcePath", sourcePath)
console.log("destinationPath", destinationPath)
fs.copyFile(sourcePath, destinationPath, (err)=>{
console.log(err)
})
})
//this needs to be moved to new file
var source = path.resolve(__dirname, "../node_modules/electron")
var destination = path.resolve(__dirname, "../apps/mudita-center/node_modules/electron")
if(process.platform === "win32") {
shell(`Xcopy ${source} ${destination} /E /H /C /I`);
}
else {
shell(`mkdir -p ${destination}`);
shell(`cp -r ${source}/* ${destination}`);
}