17 lines
504 B
JavaScript
17 lines
504 B
JavaScript
import symlinkDir from 'symlink-dir';
|
|
import { existsSync } from 'fs';
|
|
import { mkdir } from 'fs/promises';
|
|
|
|
(async () => {
|
|
const site = process.env.npm_config_site;
|
|
if (!!site) {
|
|
await symlinkDir(`sites/${site}`, '../frontend/content');
|
|
if (!existsSync('../frontend/dist')) {
|
|
await mkdir('../frontend/dist');
|
|
}
|
|
await symlinkDir(`sites/${site}`, '../frontend/dist/content');
|
|
console.log('done');
|
|
} else {
|
|
console.error('Parameter "site" was not provided!');
|
|
}
|
|
})();
|