repowise 0.1.59 → 0.1.61
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/dist/bin/repowise.js +18 -2
- package/package.json +1 -1
package/dist/bin/repowise.js
CHANGED
|
@@ -430,6 +430,10 @@ function decodeEmailFromIdToken(idToken) {
|
|
|
430
430
|
async function processNotifications(notifications, state, repoLocalPaths, apiUrl) {
|
|
431
431
|
let updateCount = 0;
|
|
432
432
|
for (const notif of notifications) {
|
|
433
|
+
const repoState = state.repos[notif.repoId];
|
|
434
|
+
if (repoState && notif.createdAt <= repoState.lastSyncTimestamp) {
|
|
435
|
+
continue;
|
|
436
|
+
}
|
|
433
437
|
if (notif.type === "sync.completed") {
|
|
434
438
|
const localPath = repoLocalPaths.get(notif.repoId);
|
|
435
439
|
if (localPath) {
|
|
@@ -2439,8 +2443,9 @@ async function logout() {
|
|
|
2439
2443
|
// src/commands/status.ts
|
|
2440
2444
|
import { readFile as readFile9 } from "fs/promises";
|
|
2441
2445
|
import { homedir as homedir9 } from "os";
|
|
2442
|
-
import { join as join13 } from "path";
|
|
2446
|
+
import { basename, join as join13 } from "path";
|
|
2443
2447
|
var STATE_PATH2 = join13(homedir9(), ".repowise", "listener-state.json");
|
|
2448
|
+
var CONFIG_PATH3 = join13(homedir9(), ".repowise", "config.json");
|
|
2444
2449
|
async function status() {
|
|
2445
2450
|
let state = null;
|
|
2446
2451
|
try {
|
|
@@ -2478,11 +2483,22 @@ async function status() {
|
|
|
2478
2483
|
console.log("No sync history. Run `repowise listen` to start syncing.");
|
|
2479
2484
|
return;
|
|
2480
2485
|
}
|
|
2486
|
+
const repoNames = /* @__PURE__ */ new Map();
|
|
2487
|
+
try {
|
|
2488
|
+
const configData = await readFile9(CONFIG_PATH3, "utf-8");
|
|
2489
|
+
const config2 = JSON.parse(configData);
|
|
2490
|
+
for (const repo of config2.repos ?? []) {
|
|
2491
|
+
repoNames.set(repo.repoId, basename(repo.localPath));
|
|
2492
|
+
}
|
|
2493
|
+
} catch {
|
|
2494
|
+
}
|
|
2481
2495
|
console.log("Watched Repos:");
|
|
2482
2496
|
for (const [repoId, repoState] of Object.entries(state.repos)) {
|
|
2497
|
+
const name = repoNames.get(repoId);
|
|
2498
|
+
const label = name ? `${name} (${repoId.slice(0, 8)})` : repoId;
|
|
2483
2499
|
const syncTime = repoState.lastSyncTimestamp ? new Date(repoState.lastSyncTimestamp).toLocaleString() : "never";
|
|
2484
2500
|
const commit = repoState.lastSyncCommitSha ? repoState.lastSyncCommitSha.slice(0, 7) : "none";
|
|
2485
|
-
console.log(` ${
|
|
2501
|
+
console.log(` ${label}: last sync ${syncTime} (commit: ${commit})`);
|
|
2486
2502
|
}
|
|
2487
2503
|
}
|
|
2488
2504
|
|