mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.4 KiB
42 lines
1.4 KiB
2 years ago
|
const { exec } = require('child_process');
|
||
|
const path = require('path');
|
||
|
const sdkPath = path.join(__dirname, '..', 'packages', 'nocodb-sdk');
|
||
|
const guiPath = path.join(__dirname, '..', 'packages', 'nc-gui');
|
||
|
const nocodbPath = path.join(__dirname, '..', 'packages', 'nocodb');
|
||
|
|
||
|
exec(`cd ${sdkPath} && npm i && npm run build`, (err, stdout, stderr) => {
|
||
|
if (err) {
|
||
|
console.error(`Error installing dependencies and building nocodb-sdk: ${err}`);
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
console.log(`Dependencies installed and nocodb-sdk built: ${stdout}`);
|
||
|
|
||
|
const guiPromise = new Promise((resolve, reject) => {
|
||
|
exec(`cd ${guiPath} && npm i ${sdkPath}`, (err, stdout, stderr) => {
|
||
|
if (err) {
|
||
|
reject(`Error installing dependencies for nc-gui: ${err}`);
|
||
|
} else {
|
||
|
resolve(`Dependencies installed for nc-gui: ${stdout}`);
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
|
||
|
const nocodbPromise = new Promise((resolve, reject) => {
|
||
|
exec(`cd ${nocodbPath} && npm i ${sdkPath}`, (err, stdout, stderr) => {
|
||
|
if (err) {
|
||
|
reject(`Error installing dependencies for nocodb: ${err}`);
|
||
|
} else {
|
||
|
resolve(`Dependencies installed for nocodb: ${stdout}`);
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
|
||
|
Promise.all([guiPromise, nocodbPromise])
|
||
|
.then((results) => {
|
||
|
console.log(results.join('\n'));
|
||
|
})
|
||
|
.catch((err) => {
|
||
|
console.error(err);
|
||
|
});
|
||
|
});
|