mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-10-27 03:23:20 +00:00
Prepare NFC path identity consumer validation
This commit is contained in:
1 parent
72dc88c7ef
commit
0eb7adabfd
39 files changed
+2155
-97
No files matched your search
@@ -1,4 +1,16 @@
|
||||
import { path } from "@vrtmrz/livesync-commonlib/node";
|
||||
import type { CLICommand } from "./types";
|
||||
|
||||
export function getForceRequirementError(command: CLICommand, force = false): string | undefined {
|
||||
if (force) return undefined;
|
||||
if (command === "rebuild") {
|
||||
return "Command 'rebuild' requires --force because it replaces the local and remote databases.";
|
||||
}
|
||||
if (command === "fetch") {
|
||||
return "Command 'fetch' requires --force because it replaces the local database with remote state.";
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
export function toArrayBuffer(data: Buffer): ArrayBuffer {
|
||||
return data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength) as ArrayBuffer;
|
||||
|
||||
Reference in new issue
Block a user