@deinossrl/dgp-agent 1.4.44 → 1.4.46
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/CHANGELOG.md +14 -0
- package/index.mjs +24 -18
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog - DGP Agent
|
|
2
2
|
|
|
3
|
+
## [1.4.46] - 2026-01-12
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
- Corregido error con rutas que contienen espacios al ejecutar pg_dump
|
|
7
|
+
- Entrecomillado de ruta de pg_dump.exe y archivo de salida
|
|
8
|
+
- Resuelve error "C:\Users\Eduardo no se reconoce como un comando"
|
|
9
|
+
|
|
10
|
+
## [1.4.45] - 2026-01-12
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
- Corregido error de file lock al extraer PostgreSQL binaries en Windows
|
|
14
|
+
- Agregado delay de 1 segundo después de cerrar archivo ZIP para que Windows libere el handle
|
|
15
|
+
- Resuelve el error "El proceso no puede obtener acceso al archivo... está siendo utilizado"
|
|
16
|
+
|
|
3
17
|
## [1.4.44] - 2026-01-12
|
|
4
18
|
|
|
5
19
|
### Added
|
package/index.mjs
CHANGED
|
@@ -1507,11 +1507,13 @@ async function findOrInstallPgDump() {
|
|
|
1507
1507
|
file.close();
|
|
1508
1508
|
logInfo('Descarga completada. Extrayendo...');
|
|
1509
1509
|
|
|
1510
|
-
//
|
|
1511
|
-
|
|
1512
|
-
//
|
|
1513
|
-
|
|
1514
|
-
|
|
1510
|
+
// Dar tiempo a Windows para liberar el handle del archivo
|
|
1511
|
+
setTimeout(() => {
|
|
1512
|
+
// Extraer solo pg_dump.exe y sus DLLs necesarias
|
|
1513
|
+
try {
|
|
1514
|
+
// Usar PowerShell para extraer el zip
|
|
1515
|
+
const extractCmd = `powershell -command "Expand-Archive -Path '${zipPath}' -DestinationPath '${BIN_DIR}' -Force"`;
|
|
1516
|
+
execSync(extractCmd);
|
|
1515
1517
|
|
|
1516
1518
|
// Los binarios estarán en BIN_DIR/pgsql/bin/
|
|
1517
1519
|
const extractedPgDump = join(BIN_DIR, 'pgsql', 'bin', 'pg_dump.exe');
|
|
@@ -1547,9 +1549,10 @@ async function findOrInstallPgDump() {
|
|
|
1547
1549
|
} else {
|
|
1548
1550
|
reject(new Error('No se pudo extraer pg_dump del archivo'));
|
|
1549
1551
|
}
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1552
|
+
} catch (extractError) {
|
|
1553
|
+
reject(new Error(`Error al extraer: ${extractError.message}`));
|
|
1554
|
+
}
|
|
1555
|
+
}, 1000); // Esperar 1 segundo para que Windows libere el archivo
|
|
1553
1556
|
});
|
|
1554
1557
|
}).on('error', reject);
|
|
1555
1558
|
} else {
|
|
@@ -1558,9 +1561,11 @@ async function findOrInstallPgDump() {
|
|
|
1558
1561
|
file.close();
|
|
1559
1562
|
logInfo('Descarga completada. Extrayendo...');
|
|
1560
1563
|
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
+
// Dar tiempo a Windows para liberar el handle del archivo
|
|
1565
|
+
setTimeout(() => {
|
|
1566
|
+
try {
|
|
1567
|
+
const extractCmd = `powershell -command "Expand-Archive -Path '${zipPath}' -DestinationPath '${BIN_DIR}' -Force"`;
|
|
1568
|
+
execSync(extractCmd);
|
|
1564
1569
|
|
|
1565
1570
|
const extractedPgDump = join(BIN_DIR, 'pgsql', 'bin', 'pg_dump.exe');
|
|
1566
1571
|
|
|
@@ -1591,9 +1596,10 @@ async function findOrInstallPgDump() {
|
|
|
1591
1596
|
} else {
|
|
1592
1597
|
reject(new Error('No se pudo extraer pg_dump del archivo'));
|
|
1593
1598
|
}
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1599
|
+
} catch (extractError) {
|
|
1600
|
+
reject(new Error(`Error al extraer: ${extractError.message}`));
|
|
1601
|
+
}
|
|
1602
|
+
}, 1000); // Esperar 1 segundo para que Windows libere el archivo
|
|
1597
1603
|
});
|
|
1598
1604
|
}
|
|
1599
1605
|
}).on('error', (err) => {
|
|
@@ -1732,11 +1738,11 @@ async function executePgDump(command) {
|
|
|
1732
1738
|
});
|
|
1733
1739
|
}
|
|
1734
1740
|
|
|
1735
|
-
// Archivo de salida
|
|
1736
|
-
pgDumpArgs.push(`--file
|
|
1741
|
+
// Archivo de salida (entrecomillar por si tiene espacios)
|
|
1742
|
+
pgDumpArgs.push(`--file="${localFilePath}"`);
|
|
1737
1743
|
|
|
1738
|
-
// Ejecutar pg_dump
|
|
1739
|
-
const fullCommand =
|
|
1744
|
+
// Ejecutar pg_dump (entrecomillar ruta por si tiene espacios)
|
|
1745
|
+
const fullCommand = `"${pgDumpCmd}" ${pgDumpArgs.join(' ')}`;
|
|
1740
1746
|
logCommand(`Ejecutando: pg_dump [conexión oculta]`);
|
|
1741
1747
|
await addCommandLog('command', 'Ejecutando pg_dump...');
|
|
1742
1748
|
|