1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-12-20 23:30:05 +02:00
This commit is contained in:
Laurent Cozic
2021-06-26 22:13:38 +01:00
parent 05e4b32d9b
commit 1bf17a6d87
70 changed files with 909 additions and 212 deletions

View File

@@ -1,4 +1,4 @@
import { syncDir, synchronizer, supportDir, loadEncryptionMasterKey, setupDatabaseAndSynchronizer, switchClient } from '../testing/test-utils';
import { syncDir, synchronizer, supportDir, loadEncryptionMasterKey, setupDatabaseAndSynchronizer, switchClient, synchronizerStart } from '../testing/test-utils';
import Setting from '../models/Setting';
import Folder from '../models/Folder';
import Note from '../models/Note';
@@ -8,6 +8,8 @@ import markdownUtils from '../markdownUtils';
import shim from '../shim';
import * as fs from 'fs-extra';
import { setEncryptionEnabled } from '../services/synchronizer/syncTargetInfoUtils';
const { shimInit } = require('../shim-init-node');
const sharp = require('sharp');
const snapshotBaseDir = `${supportDir}/syncTargetSnapshots`;
@@ -106,6 +108,8 @@ export async function deploySyncTargetSnapshot(syncTargetType: string, syncVersi
}
export async function main(syncTargetType: string) {
shimInit(sharp);
const validSyncTargetTypes = ['normal', 'e2ee'];
if (!validSyncTargetTypes.includes(syncTargetType)) throw new Error(`Sync target type must be: ${validSyncTargetTypes.join(', ')}`);
@@ -118,6 +122,8 @@ export async function main(syncTargetType: string) {
await loadEncryptionMasterKey();
}
await synchronizerStart();
await synchronizer().start();
if (!Setting.value('syncVersion')) throw new Error('syncVersion is not set');