utn-cli 2.1.43 → 2.1.44
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.
- package/commands/backend.js +2 -1
- package/package.json +1 -1
package/commands/backend.js
CHANGED
|
@@ -179,7 +179,8 @@ export async function updateBackend(opciones = { cerrarAlFinalizar: true }) {
|
|
|
179
179
|
if (fs.existsSync(rutaApiRutasDestino)) {
|
|
180
180
|
let contenidoApiRutas = fs.readFileSync(rutaApiRutasDestino, 'utf-8');
|
|
181
181
|
const importManejador = "const ManejadorDeErrores = require('../servicios/Nucleo/ManejadorDeErrores.js');";
|
|
182
|
-
|
|
182
|
+
const regexManejador = /(?:const|let|var)\s+ManejadorDeErrores\s*=\s*require\(/;
|
|
183
|
+
if (!regexManejador.test(contenidoApiRutas)) {
|
|
183
184
|
console.log('Agregando ManejadorDeErrores a rutas/API.js...');
|
|
184
185
|
fs.writeFileSync(rutaApiRutasDestino, importManejador + '\n' + contenidoApiRutas);
|
|
185
186
|
}
|