sftp-push-sync 1.0.5 ā 1.0.7
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/bin/sftp-push-sync.mjs +9 -9
- package/package.json +2 -2
package/bin/sftp-push-sync.mjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
** sync
|
|
3
|
+
** sftp-push-sync.mjs - SFTP Syncronisations Tool
|
|
4
|
+
*
|
|
5
|
+
* @author Carsten Nichte, 2025 / https://carsten-nichte.de
|
|
4
6
|
*
|
|
5
7
|
* SFTP push sync with dry run
|
|
6
8
|
* 1. Upload new files
|
|
@@ -18,11 +20,9 @@
|
|
|
18
20
|
* - Parallel uploads/deletes via worker pool
|
|
19
21
|
* - include/exclude patterns
|
|
20
22
|
*
|
|
21
|
-
* The file
|
|
23
|
+
* The file sftp-push-sync.mjs is pure JavaScript (ESM), not TypeScript.
|
|
22
24
|
* Node.js can execute it directly as long as "type": "module" is specified in package.json
|
|
23
25
|
* or the file has the extension .mjs.
|
|
24
|
-
*
|
|
25
|
-
* @author Carsten Nichte, 2025 / https://carsten-nichte.de
|
|
26
26
|
*/
|
|
27
27
|
import fs from "fs";
|
|
28
28
|
import fsp from "fs/promises";
|
|
@@ -424,8 +424,8 @@ async function main() {
|
|
|
424
424
|
log("\n\n==================================================================");
|
|
425
425
|
log(pc.bold("š SFTP Push-Synchronisation: sftp-push-sync"));
|
|
426
426
|
log(` Connection: ${pc.cyan(TARGET)} (Worker: ${CONNECTION.workers})`);
|
|
427
|
-
log(` Host:
|
|
428
|
-
log(` Local:
|
|
427
|
+
log(` Host: ${pc.green(CONNECTION.host)}:${pc.green(CONNECTION.port)}`);
|
|
428
|
+
log(` Local: ${pc.green(CONNECTION.localRoot)}`);
|
|
429
429
|
log(` Remote: ${pc.green(CONNECTION.remoteRoot)}`);
|
|
430
430
|
if (DRY_RUN) log(pc.yellow(" Modus: DRY-RUN (no changes)"));
|
|
431
431
|
log("-----------------------------------------------------------------\n");
|
|
@@ -453,7 +453,7 @@ async function main() {
|
|
|
453
453
|
|
|
454
454
|
log(pc.bold(pc.cyan("š„ Phase 1: Scan local files ā¦")));
|
|
455
455
|
const local = await walkLocal(CONNECTION.localRoot);
|
|
456
|
-
log(` ā ${local.size}
|
|
456
|
+
log(` ā ${local.size} local files`);
|
|
457
457
|
|
|
458
458
|
log(pc.bold(pc.cyan("š¤ Phase 2: Scan remote files ā¦")));
|
|
459
459
|
const remote = await walkRemote(sftp, CONNECTION.remoteRoot);
|
|
@@ -620,10 +620,10 @@ async function main() {
|
|
|
620
620
|
|
|
621
621
|
// Summary
|
|
622
622
|
log("\n" + pc.bold(pc.cyan("š Summary:")));
|
|
623
|
-
log(`
|
|
623
|
+
log(` Duration: ${pc.green(duration + " s")}`);
|
|
624
624
|
log(` ${ADD} Added : ${toAdd.length}`);
|
|
625
625
|
log(` ${CHA} Changed: ${toUpdate.length}`);
|
|
626
|
-
log(` ${DEL} Deleted:
|
|
626
|
+
log(` ${DEL} Deleted: ${toDelete.length}`);
|
|
627
627
|
|
|
628
628
|
if (toAdd.length || toUpdate.length || toDelete.length) {
|
|
629
629
|
log("\nš Changes:");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sftp-push-sync",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "SFTP sync tool for Hugo projects (local to remote, with hash cache)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"sync"
|
|
20
20
|
],
|
|
21
21
|
"author": "Carsten Nichte",
|
|
22
|
-
"license": "
|
|
22
|
+
"license": "GPL-3.0-or-later",
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"ssh2-sftp-client": "^10.0.0",
|
|
25
25
|
"minimatch": "^9.0.3",
|