mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-15 17:14:05 -08:00
af49e95cc7
Signed-off-by: Oleg Ivaniv <[email protected]> Co-authored-by: Jan Oberhauser <[email protected]> Co-authored-by: Jesper Bylund <[email protected]> Co-authored-by: OlegIvaniv <[email protected]> Co-authored-by: Deborah <[email protected]> Co-authored-by: Jan Oberhauser <[email protected]> Co-authored-by: Jon <[email protected]> Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <[email protected]> Co-authored-by: Michael Kret <[email protected]> Co-authored-by: Giulio Andreini <[email protected]> Co-authored-by: Mason Geloso <[email protected]> Co-authored-by: Mason Geloso <[email protected]> Co-authored-by: Mutasem Aldmour <[email protected]>
37 lines
1.3 KiB
JavaScript
37 lines
1.3 KiB
JavaScript
const path = require('path');
|
|
const shelljs = require('shelljs');
|
|
const glob = require('fast-glob');
|
|
|
|
const rootDirPath = path.resolve(__dirname, '..');
|
|
const n8nRootDirPath = path.resolve(rootDirPath, '..', '..', '..');
|
|
const distDirPath = path.resolve(rootDirPath, 'dist');
|
|
const srcDirPath = path.resolve(rootDirPath, 'src');
|
|
const libDirPath = path.resolve(rootDirPath, 'tmp', 'lib');
|
|
const cjsDirPath = path.resolve(rootDirPath, 'tmp', 'cjs');
|
|
|
|
const packageJsonFilePath = path.resolve(rootDirPath, 'package.json');
|
|
const readmeFilePath = path.resolve(rootDirPath, 'README.md');
|
|
const licenseFilePath = path.resolve(n8nRootDirPath, 'LICENSE.md');
|
|
|
|
shelljs.cp(packageJsonFilePath, distDirPath);
|
|
shelljs.cp(readmeFilePath, distDirPath);
|
|
shelljs.cp(licenseFilePath, distDirPath);
|
|
|
|
shelljs.mv(path.resolve(distDirPath, 'src'), path.resolve(distDirPath, 'types'));
|
|
|
|
function moveFiles(files, from, to) {
|
|
files.forEach((file) => {
|
|
const toFile = file.replace(from, to);
|
|
shelljs.mkdir('-p', path.dirname(toFile));
|
|
shelljs.mv(file, toFile);
|
|
});
|
|
}
|
|
|
|
const cjsFiles = glob.sync(path.resolve(cjsDirPath, '**', '*'));
|
|
moveFiles(cjsFiles, 'tmp/cjs', 'dist');
|
|
shelljs.rm('-rf', cjsDirPath);
|
|
|
|
const libFiles = glob.sync(path.resolve(libDirPath, '**/*'));
|
|
moveFiles(libFiles, 'tmp/lib', 'dist');
|
|
shelljs.rm('-rf', libDirPath);
|