@geml/logseq-sync 2.0.4 → 2.0.5
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/package.json +1 -1
- package/watcher/bin/logseq-sync.mjs +21 -9
package/package.json
CHANGED
|
@@ -280,13 +280,13 @@ function resolveGraphOrExit() {
|
|
|
280
280
|
if (detected?.candidates) {
|
|
281
281
|
console.error(
|
|
282
282
|
`Error: several graphs and none open in the app — ${detected.candidates.join(", ")}. ` +
|
|
283
|
-
`Pick one with --graph <name
|
|
283
|
+
`Pick one with --graph <name>. Run \`logseq-sync doctor\` for the full picture.`
|
|
284
284
|
);
|
|
285
285
|
process.exit(2);
|
|
286
286
|
}
|
|
287
287
|
console.error(
|
|
288
288
|
`Error: no Logseq graphs found under ${join(logseqRootDir(probe), "graphs")}. ` +
|
|
289
|
-
`Open a graph in Logseq first
|
|
289
|
+
`Open a graph in Logseq first. Run \`logseq-sync doctor\` for the full picture.`
|
|
290
290
|
);
|
|
291
291
|
process.exit(2);
|
|
292
292
|
}
|
|
@@ -295,7 +295,8 @@ function resolveVaultOrExit() {
|
|
|
295
295
|
if (vaultRaw) return resolve(expandHome(vaultRaw));
|
|
296
296
|
console.error(
|
|
297
297
|
`Error: no vault directory. Set it in Logseq — Settings → Plugins → ${PLUGIN_TITLE} → ` +
|
|
298
|
-
`"Vault folder" — or pass one: logseq-sync <vault-dir
|
|
298
|
+
`"Vault folder" — or pass one: logseq-sync <vault-dir>. ` +
|
|
299
|
+
`Run \`logseq-sync doctor\` for the full picture.`
|
|
299
300
|
);
|
|
300
301
|
process.exit(2);
|
|
301
302
|
}
|
|
@@ -407,13 +408,24 @@ if (!/^[a-zA-Z0-9_][a-zA-Z0-9_.-]*$/.test(graphName)) {
|
|
|
407
408
|
|
|
408
409
|
// `logseq graph export --graph <name>` does not fail on an unknown name — it
|
|
409
410
|
// CREATES that graph and exports the empty result. A typo would then sync
|
|
410
|
-
// emptiness over the vault and commit it. Refuse names we cannot see
|
|
411
|
-
//
|
|
412
|
-
//
|
|
413
|
-
|
|
411
|
+
// emptiness over the vault and commit it. Refuse names we cannot see,
|
|
412
|
+
// INCLUDING when we see none at all: a bare run calls zero graphs a hard
|
|
413
|
+
// error, and naming one does not make graphs exist — treating the same state
|
|
414
|
+
// as "cannot verify, proceed" is how `--graph demo` once sailed past this
|
|
415
|
+
// check straight into the vault error, and reads as a contradiction. The
|
|
416
|
+
// escape hatches are real, not hypothetical: LOGSEQ_ROOT_DIR when the graphs
|
|
417
|
+
// live elsewhere, and the API-server route, which exports whatever graph the
|
|
418
|
+
// app has open and ignores local directories entirely.
|
|
419
|
+
if (!apiServerToken && !knownGraphs.includes(graphName)) {
|
|
414
420
|
console.error(
|
|
415
|
-
|
|
416
|
-
`
|
|
421
|
+
knownGraphs.length > 0
|
|
422
|
+
? `Error: no graph named "${graphName}" — found ${knownGraphs.join(", ")}. ` +
|
|
423
|
+
`(The app CLI would silently create "${graphName}" rather than fail.) ` +
|
|
424
|
+
`Run \`logseq-sync doctor\` for the full picture.`
|
|
425
|
+
: `Error: no graph named "${graphName}" — no graphs found under ` +
|
|
426
|
+
`${join(logseqRootDir(probe), "graphs")} at all, and the app CLI would silently ` +
|
|
427
|
+
`create "${graphName}" and sync emptiness. If your graphs live elsewhere, set ` +
|
|
428
|
+
`LOGSEQ_ROOT_DIR. Run \`logseq-sync doctor\` for the full picture.`
|
|
417
429
|
);
|
|
418
430
|
process.exit(2);
|
|
419
431
|
}
|