feat: unifica lo smistamento CAD su destinazione unica configurabile da UI

This commit is contained in:
2026-03-05 16:11:01 +01:00
parent 7008f57119
commit cc38413400
8 changed files with 194 additions and 130 deletions

View File

@@ -2,6 +2,11 @@ const path = require('path');
function findDestination(filename, config) {
const ext = path.extname(filename).slice(1).toLowerCase();
const globalDestination = typeof config?.destination === 'string' ? config.destination.trim() : '';
if (globalDestination && ['prt', 'asm', 'dwr'].includes(ext)) {
return globalDestination;
}
for (const rule of config.rules || []) {
if ((rule.ext || '').toLowerCase() !== ext) {
@@ -23,7 +28,7 @@ function findDestination(filename, config) {
function isCadFile(filename) {
const ext = path.extname(filename).slice(1).toLowerCase();
return ['prt', 'asm', 'drw'].includes(ext);
return ['prt', 'asm', 'dwr'].includes(ext);
}
module.exports = { findDestination, isCadFile };