utn-cli 2.1.48 → 2.1.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -178,11 +178,25 @@ export async function updateBackend(opciones = { cerrarAlFinalizar: true }) {
178
178
  const rutaApiRutasDestino = path.join(directorioDestino, 'rutas', 'API.js');
179
179
  if (fs.existsSync(rutaApiRutasDestino)) {
180
180
  let contenidoApiRutas = fs.readFileSync(rutaApiRutasDestino, 'utf-8');
181
+ let archivoModificado = false;
182
+
183
+ // Corregir error tipográfico moitoreo -> monitoreo
184
+ if (contenidoApiRutas.includes('moitoreo')) {
185
+ console.log('Corrigiendo typo moitoreo a monitoreo en rutas/API.js...');
186
+ contenidoApiRutas = contenidoApiRutas.replace(/moitoreo/g, 'monitoreo');
187
+ archivoModificado = true;
188
+ }
189
+
181
190
  const importManejador = "const ManejadorDeErrores = require('../servicios/Nucleo/ManejadorDeErrores.js');";
182
191
  const regexManejador = /(?:const|let|var)\s+ManejadorDeErrores\s*=\s*require\(/;
183
192
  if (!regexManejador.test(contenidoApiRutas)) {
184
193
  console.log('Agregando ManejadorDeErrores a rutas/API.js...');
185
- fs.writeFileSync(rutaApiRutasDestino, importManejador + '\n' + contenidoApiRutas);
194
+ contenidoApiRutas = importManejador + '\n' + contenidoApiRutas;
195
+ archivoModificado = true;
196
+ }
197
+
198
+ if (archivoModificado) {
199
+ fs.writeFileSync(rutaApiRutasDestino, contenidoApiRutas);
186
200
  }
187
201
  }
188
202
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "utn-cli",
3
- "version": "2.1.48",
3
+ "version": "2.1.50",
4
4
  "description": "Herramienta CLI unificada para la gestión de plantillas en SIGU.",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -1,4 +1,4 @@
1
- Error.stackTraceLimit = Infinity;
1
+ Error.stackTraceLimit = 25;
2
2
  const express = require('express');
3
3
  const helmet = require('helmet');
4
4
  const cors = require('cors');