feat: unifica lo smistamento CAD su destinazione unica configurabile da UI
This commit is contained in:
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user