mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-11-06 08:18:18 +00:00
Default new CLI and Obsidian environments to NFC path identity
This commit is contained in:
1 parent
ac502b0261
commit
39cc31c2e8
26 files changed
+1466
-61
No files matched your search
@@ -0,0 +1,20 @@
|
||||
import {
|
||||
REMOTE_COUCHDB,
|
||||
REMOTE_MINIO,
|
||||
type ObsidianLiveSyncSettings,
|
||||
} from "@vrtmrz/livesync-commonlib/compat/common/types";
|
||||
import type { RemoteConnectionProbe } from "@vrtmrz/livesync-commonlib/replication";
|
||||
import { resolveInitialPathIdentity } from "@/common/initialPathIdentity";
|
||||
|
||||
/** Adopt an existing central remote only for the first explicit Fetch. */
|
||||
export async function resolveInitialFetchPathIdentity(
|
||||
settings: ObsidianLiveSyncSettings,
|
||||
createProbe: () => Promise<RemoteConnectionProbe | undefined>
|
||||
): Promise<0 | 1 | undefined> {
|
||||
if (settings.isConfigured) return undefined;
|
||||
const hasRemote =
|
||||
(settings.remoteType === REMOTE_COUCHDB && !!settings.couchDB_URI && !!settings.couchDB_DBNAME) ||
|
||||
(settings.remoteType === REMOTE_MINIO && !!settings.endpoint && !!settings.bucket);
|
||||
if (!hasRemote) return undefined;
|
||||
return await resolveInitialPathIdentity(await createProbe(), settings.pathNormalizationVersion);
|
||||
}
|
||||
Reference in new issue
Block a user