code style
Some checks are pending
Run tests / test-runner (push) Waiting to run

This commit is contained in:
Jan Prochazka 2024-11-15 17:16:11 +01:00
parent 6fdb20fc34
commit c0595aec0a

View File

@ -5,7 +5,7 @@ const volatilePackages = require('./common/volatilePackages');
function adjustFile(file, isApp = false) {
const json = JSON.parse(fs.readFileSync(file, { encoding: 'utf-8' }));
function processFile(packageFile) {
function processPackageFile(packageFile) {
const pluginJson = JSON.parse(fs.readFileSync(packageFile, { encoding: 'utf-8' }));
for (const depkey of ['dependencies', 'optionalDependencies']) {
for (const dependency of Object.keys(pluginJson[depkey] || {})) {
@ -29,12 +29,12 @@ function adjustFile(file, isApp = false) {
for (const packageName of fs.readdirSync('plugins')) {
if (!packageName.startsWith('dbgate-plugin-')) continue;
processFile(path.join('plugins', packageName, 'package.json'));
processPackageFile(path.join('plugins', packageName, 'package.json'));
}
if (isApp) {
// add volatile dependencies from api to app
processFile(path.join('packages', 'api', 'package.json'));
processPackageFile(path.join('packages', 'api', 'package.json'));
}
if (process.platform != 'win32') {