mirror of
https://github.com/remotely-save/remotely-save.git
synced 2024-06-07 21:10:45 +00:00
fix var in dropbox
This commit is contained in:
parent
9e4fed4504
commit
437e041e71
@ -26,6 +26,10 @@ export const DEFAULT_DROPBOX_CONFIG = {
|
|||||||
|
|
||||||
export const getDropboxPath = (fileOrFolderPath: string, vaultName: string) => {
|
export const getDropboxPath = (fileOrFolderPath: string, vaultName: string) => {
|
||||||
let key = fileOrFolderPath;
|
let key = fileOrFolderPath;
|
||||||
|
if (fileOrFolderPath === "/" || fileOrFolderPath === "") {
|
||||||
|
// special
|
||||||
|
key = `/${vaultName}`;
|
||||||
|
}
|
||||||
if (!fileOrFolderPath.startsWith("/")) {
|
if (!fileOrFolderPath.startsWith("/")) {
|
||||||
// then this is original path in Obsidian
|
// then this is original path in Obsidian
|
||||||
key = `/${vaultName}/${fileOrFolderPath}`;
|
key = `/${vaultName}/${fileOrFolderPath}`;
|
||||||
@ -320,6 +324,7 @@ export class WrappedDropboxClient {
|
|||||||
path: `/${this.vaultName}`,
|
path: `/${this.vaultName}`,
|
||||||
});
|
});
|
||||||
console.log(`remote folder /${this.vaultName} created`);
|
console.log(`remote folder /${this.vaultName} created`);
|
||||||
|
this.vaultFolderExists = true;
|
||||||
} else {
|
} else {
|
||||||
// console.log(`remote folder /${this.vaultName} exists`);
|
// console.log(`remote folder /${this.vaultName} exists`);
|
||||||
}
|
}
|
||||||
@ -541,6 +546,8 @@ export const downloadFromRemote = async (
|
|||||||
password: string = "",
|
password: string = "",
|
||||||
remoteEncryptedKey: string = ""
|
remoteEncryptedKey: string = ""
|
||||||
) => {
|
) => {
|
||||||
|
await client.init();
|
||||||
|
|
||||||
const isFolder = fileOrFolderPath.endsWith("/");
|
const isFolder = fileOrFolderPath.endsWith("/");
|
||||||
|
|
||||||
await mkdirpInVault(fileOrFolderPath, vault);
|
await mkdirpInVault(fileOrFolderPath, vault);
|
||||||
|
Loading…
Reference in New Issue
Block a user