Squashed commit of sync hidden files:
commit 73967756d51d246b3ca203aa3683cdfebf567000 Author: fyears <1142836+fyears@users.noreply.github.com> Date: Sun Mar 13 22:41:28 2022 +0800 fix typo commit 08e16faa9a9ace9bec71acb723e0d70ca361d49f Author: fyears <1142836+fyears@users.noreply.github.com> Date: Sun Mar 13 22:41:01 2022 +0800 add modal in settings commit 9db7194fa28cb62b1fa4c01ac7f746d5ac3b86a8 Author: fyears <1142836+fyears@users.noreply.github.com> Date: Sun Mar 13 22:03:00 2022 +0800 working sync for .obsidian and _ commit 4be24ba092181c1c3e1aabe5e9d4e9fcff28f987 Author: fyears <1142836+fyears@users.noreply.github.com> Date: Sun Mar 13 16:07:10 2022 +0800 more logic for hidden path
This commit is contained in:
+15
@@ -37,6 +37,7 @@ import { RemotelySaveSettingTab } from "./settings";
|
||||
import { fetchMetadataFile, parseRemoteItems, SyncStatusType } from "./sync";
|
||||
import { doActualSync, getSyncPlan, isPasswordOk } from "./sync";
|
||||
import { messyConfigToNormal, normalConfigToMessy } from "./configPersist";
|
||||
import { ObsConfigDirFileType, listFilesInObsFolder } from "./obsFolderLister";
|
||||
|
||||
import * as origLog from "loglevel";
|
||||
import { DeletionOnRemote, MetadataOnRemote } from "./metadataOnRemote";
|
||||
@@ -56,6 +57,8 @@ const DEFAULT_SETTINGS: RemotelySavePluginSettings = {
|
||||
initRunAfterMilliseconds: -1,
|
||||
agreeToUploadExtraMetadata: false,
|
||||
concurrency: 5,
|
||||
syncConfigDir: false,
|
||||
syncUnderscoreItems: false,
|
||||
};
|
||||
|
||||
interface OAuth2Info {
|
||||
@@ -190,6 +193,14 @@ export default class RemotelySavePlugin extends Plugin {
|
||||
this.db,
|
||||
this.settings.vaultRandomID
|
||||
);
|
||||
let localConfigDirContents: ObsConfigDirFileType[] = undefined;
|
||||
if (this.settings.syncConfigDir) {
|
||||
localConfigDirContents = await listFilesInObsFolder(
|
||||
this.app.vault.configDir,
|
||||
this.app.vault,
|
||||
this.manifest.id
|
||||
);
|
||||
}
|
||||
// log.info(local);
|
||||
// log.info(localHistory);
|
||||
|
||||
@@ -198,10 +209,14 @@ export default class RemotelySavePlugin extends Plugin {
|
||||
const { plan, sortedKeys, deletions } = await getSyncPlan(
|
||||
remoteStates,
|
||||
local,
|
||||
localConfigDirContents,
|
||||
origMetadataOnRemote.deletions,
|
||||
localHistory,
|
||||
client.serviceType,
|
||||
this.app.vault,
|
||||
this.settings.syncConfigDir,
|
||||
this.app.vault.configDir,
|
||||
this.settings.syncUnderscoreItems,
|
||||
this.settings.password
|
||||
);
|
||||
log.info(plan.mixedStates); // for debugging
|
||||
|
||||
Reference in New Issue
Block a user