Compare commits
2 Commits
5e5dadba2c
...
fea0699ff1
| Author | SHA1 | Date | |
|---|---|---|---|
| fea0699ff1 | |||
| 82becb7569 |
21
LICENSE
Normal file
21
LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 Davide Grilli
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
59
README.md
Normal file
59
README.md
Normal file
@@ -0,0 +1,59 @@
|
||||
# CadRoute
|
||||
|
||||
Smistatore automatico di file CAD (Creo) per Windows e Linux.
|
||||
|
||||
Analizza una cartella o un archivio `.zip`, riconosce i file CAD (`.prt`, `.asm`, `.drw`) e li copia automaticamente nella sottocartella di destinazione corretta, basandosi sulla struttura numerica del nome file.
|
||||
|
||||
## Funzionalità
|
||||
|
||||
- Smistamento da cartella o archivio ZIP (con drag & drop)
|
||||
- Routing automatico basato sul gruppo di cifre nel nome file
|
||||
- Gestione versioni: mantiene solo la versione più alta
|
||||
- Cartelle speciali: `__NON_SMISTATI`, `__DUPLICATI`, `__SALTATI`
|
||||
- Anteprima e pulizia delle cartelle speciali
|
||||
- Guida utente integrata (Help → Documentazione)
|
||||
- Destinazione persistente tra le sessioni
|
||||
|
||||
## Avvio in sviluppo
|
||||
|
||||
```bash
|
||||
npm install
|
||||
npm run dev
|
||||
```
|
||||
|
||||
## Build
|
||||
|
||||
### Linux (Docker)
|
||||
|
||||
```bash
|
||||
cd contrib/linux
|
||||
./build.sh
|
||||
```
|
||||
|
||||
### Windows (Docker + Wine)
|
||||
|
||||
```bash
|
||||
cd contrib/windows
|
||||
./build.sh
|
||||
```
|
||||
|
||||
Gli artefatti vengono generati in `dist/`.
|
||||
|
||||
## Struttura cartelle speciali
|
||||
|
||||
| Cartella | Contenuto |
|
||||
|----------|-----------|
|
||||
| `__NON_SMISTATI` | File CAD senza destinazione valida |
|
||||
| `__DUPLICATI` | File CAD già presenti in destinazione |
|
||||
| `__SALTATI` | File non CAD (PDF, immagini, ecc.) |
|
||||
|
||||
- **Linux:** `~/.cadroute/<cartella>/`
|
||||
- **Windows:** `%APPDATA%\CadRoute\<cartella>\`
|
||||
|
||||
## Autore
|
||||
|
||||
Davide Grilli — Cevolani Italia s.r.l.
|
||||
|
||||
## Licenza
|
||||
|
||||
MIT
|
||||
2
main.js
2
main.js
@@ -14,7 +14,7 @@ const {
|
||||
clearSkippedFiles,
|
||||
} = require('./services/unrouted');
|
||||
|
||||
const CAD_EXTENSIONS = ['prt', 'asm', 'dwr'];
|
||||
const CAD_EXTENSIONS = ['prt', 'asm', 'drw'];
|
||||
const DEFAULT_DESTINATION = 'X:\\';
|
||||
const SETTINGS_FILENAME = 'cad-router-settings.json';
|
||||
const LINUX_RUNTIME_DIR = '.cadroute';
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
<td>File di assemblaggio Creo</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="badge dwr">.dwr</span></td>
|
||||
<td><span class="badge dwr">.drw</span></td>
|
||||
<td>Drawing</td>
|
||||
<td>File di disegno Creo</td>
|
||||
</tr>
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
const path = require('path');
|
||||
|
||||
function normalizeCadType(ext) {
|
||||
const lowerExt = String(ext || '').toLowerCase();
|
||||
return lowerExt === 'drw' ? 'dwr' : lowerExt;
|
||||
return String(ext || '').toLowerCase();
|
||||
}
|
||||
|
||||
function getCadInfo(filename) {
|
||||
const baseName = path.basename(filename);
|
||||
const match = baseName.match(/^(.*)\.(prt|asm|drw|dwr)(?:\.([^.]+))?$/i);
|
||||
const match = baseName.match(/^(.*)\.(prt|asm|drw)(?:\.([^.]+))?$/i);
|
||||
if (!match) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user