1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-15 09:04:04 +02:00
joplin/packages/app-desktop/tools/copyPluginAssets.js
2021-12-27 19:47:17 +01:00

26 lines
593 B
JavaScript

const { copy, mkdirp, remove } = require('fs-extra');
async function main() {
const rootDir = `${__dirname}/..`;
const sourceDir = `${rootDir}/../../packages/renderer/assets`;
const destDirs = [
`${rootDir}/gui/note-viewer/pluginAssets`,
`${rootDir}/pluginAssets`,
];
for (const action of ['delete', 'copy']) {
for (const destDir of destDirs) {
if (action === 'delete') {
await remove(destDir);
} else {
console.info(`Copying to ${destDir}`);
await mkdirp(destDir);
await copy(sourceDir, destDir, { overwrite: true });
}
}
}
}
module.exports = main;